how high is a page?

Discussion in 'Javascript' started by Merlin, Jul 6, 2004.

  1. Merlin

    Merlin Guest

    Hi there,

    I am wondering if there is a solution with JS to find out how high a page is.
    How many pixels. Depending on how much content is on each dynamic site, I would
    like to place other content on another row.

    Thank you for any hint,

    Merlin
    Merlin, Jul 6, 2004
    #1
    1. Advertising

  2. Merlin

    kaeli Guest

    In article <>,
    enlightened us with...
    > Hi there,
    >
    > I am wondering if there is a solution with JS to find out how high a page is.
    > How many pixels. Depending on how much content is on each dynamic site, I would
    > like to place other content on another row.
    >



    Wow. All your users have the same screen resolution? Neat.

    ;)

    [You should really use percents, not pixels. Good coding negates the
    need to do this sort of check at all.]

    --
    --
    ~kaeli~
    A lot of money is tainted - It taint yours and it taint mine.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Jul 6, 2004
    #2
    1. Advertising

  3. > I am wondering if there is a solution with JS to find out how high a page is.
    > How many pixels. Depending on how much content is on each dynamic site, I would
    > like to place other content on another row.


    There is a way to do this but it is highly innacurate. If you use
    padding styles anywhere within the range you are measuring, those
    padding distances are ignored. As such, you can only use margins when
    working needing to get a more accurate measurement of the rendered
    height or width of a DOM Elem.

    To get the height of an object `o` use o.offsetHeight, for the width
    use o.offsetWidth. For measuring the window size, in IE use
    document.body.clientHeight & document.body.clientWidth in Moz use
    window.innerHeight & window.innerWidth.

    I know these properties work with IE and Moz but have not tested on
    anything other browsers.

    Good luck!

    JsD
    Java script Dude, Jul 7, 2004
    #3
  4. Merlin

    Mike Foster Guest

    Merlin wrote:

    > I am wondering if there is a solution with JS to find out how high a page is.
    > How many pixels. Depending on how much content is on each dynamic site, I would
    > like to place other content on another row.


    Try the following page with different browsers. Perhaps it will be helpful.
    <URL: http://cross-browser.com/x/test/clientheight.html>
    Mike Foster, Jul 7, 2004
    #4
    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. Midnight Java Junkie

    future of high-speed cable modems?

    Midnight Java Junkie, Jun 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    451
    Midnight Java Junkie
    Jun 20, 2004
  2. S Gupta
    Replies:
    0
    Views:
    985
    S Gupta
    Dec 28, 2003
  3. whizkid
    Replies:
    3
    Views:
    3,066
  4. Weng Tianxiang
    Replies:
    0
    Views:
    516
    Weng Tianxiang
    Apr 8, 2005
  5. Jerry L. Gubka

    Web Page = High CPU Usage?

    Jerry L. Gubka, Jan 3, 2004, in forum: HTML
    Replies:
    2
    Views:
    783
Loading...

Share This Page