How can I get visible area on Android browser?

Discussion in 'Javascript' started by junkotani, Jan 24, 2010.

  1. junkotani

    junkotani Guest

    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.
    junkotani, Jan 24, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    1
    Views:
    595
    Larry Barowski
    Jun 27, 2005
  2. hotadvice
    Replies:
    14
    Views:
    702
    hotadvice
    Oct 2, 2007
  3. Andy B.
    Replies:
    0
    Views:
    805
    Andy B.
    Apr 30, 2010
  4. Stef Mientki
    Replies:
    0
    Views:
    593
    Stef Mientki
    Nov 27, 2011
  5. sterta bole
    Replies:
    0
    Views:
    776
    sterta bole
    Aug 27, 2012
Loading...

Share This Page