How can I get visible area on Android browser?

J

junkotani

I'm trying to get current visible area size on Android browser.
But there seems to be no way to get it.

Here, I mean "current visible area" like this:
- As web page zooms in, "current visible area" becomes smaller.
- As web page zooms out, "current visible area" becomes wider.

I can get the size by "window.innerWidth" and "window.innerHeight" on
iPhone browser, but cannot on Android.

I tested the below code to find out attributes which return current
visible area size,
but no attribute returns values I want to get on Android.

How can I get the size?
If you know more proper mailing list please tell me it.

Thanks.

--------
Test code is like this:

var s = "window.width: " + window.width + "\n" +
"window.innerWidth: " + window.innerWidth + "\n" +
"window.scrollWidth: " + window.scrollWidth + "\n" +
"window.offsetWidth: " + window.offsetWidth + "\n" +
"window.clientWidth: " + window.clientWidth + "\n" +
"screen.width: " + screen.width + "\n" +
"screen.height: " + screen.height + "\n" +
"screen.availWidth: " + screen.availWidth + "\n" +
"screen.availHeight: " + screen.availHeight + "\n" +
"screen.availLeft: " + screen.availLeft + "\n" +
"screen.availTop: " + screen.availTop + "\n" +
"screen.innerWidth: " + screen.innerWidth + "\n" +
"screen.scrollWidth: " + screen.scrollWidth + "\n" +
"screen.offsetWidth: " + screen.offsetWidth + "\n" +
"screen.clientWidth: " + screen.clientWidth + "\n" +
"screen.innerWidth: " + screen.innerWidth + "\n" +
"screen.innerHeight: " + screen.innerHeight + "\n" +
"screen.outerWidth: " + screen.outerWidth + "\n" +
"screen.outerHeight: " + screen.outerHeight + "\n" +
"document.width: " + document.width + "\n" +
"document.innerWidth: " + document.innerWidth + "\n" +
"document.scrollWidth: " + document.scrollWidth + "\n" +
"document.offsetWidth: " + document.offsetWidth + "\n" +
"document.clientWidth: " + document.clientWidth + "\n" +
"document.body.width: " + document.body.width + "\n" +
"document.body.innerWidth: " + document.body.innerWidth + "\n" +
"document.body.scrollWidth: " + document.body.scrollWidth + "\n" +
"document.body.offsetWidth: " + document.body.offsetWidth + "\n" +
"document.body.clientWidth: " + document.body.clientWidth + "\n" +
"document.documentElement.width: " +
document.documentElement.width + "\n" +
"document.documentElement.innerWidth: " +
document.documentElement.innerWidth + "\n" +
"document.documentElement.scrollWidth: " +
document.documentElement.scrollWidth + "\n" +
"document.documentElement.offsetWidth: " +
document.documentElement.offsetWidth + "\n" +
"document.documentElement.clientWidth: " +
document.documentElement.clientWidth + "\n" ;

// and show this string in window.onload, onscroll, and onresize.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top