Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question using javascript to find the page height

    hi,

    does anyone know any js code to find the whole height of a web page?

    i am trying to make an image that moves from the top of the page to the bottom like a marqee. if i use document.body.offsetHeight to tell the image how far to move before returning to the top, the image only goes as far as the window height not the whole page so if you scroll down the image never reaches the bottom.

    can anyone please tell me code to find the total page height or a good substitute for the marquee tag?

    thanx

    P.S. this is the code i'm using to act on an image placed at the top of the page with the variable winH found using document.body.offsetHeight:

    var Timer1;

    function down()
    {
    document.getElementById("zip").style.pixelTop += 2;
    if (document.getElementById("zip").style.pixelTop > winH)
    {
    clearInterval(Timer1);
    document.getElementById("zip").style.pixelTop -= (winH);
    Timer1 = setInterval("down()", 15);
    }
    }
    Last edited by annalea; 02-16-2007 at 10:30 PM. Reason: added code

  • #2
    Regular Coder
    Join Date
    May 2004
    Location
    Alabama, USA
    Posts
    237
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's something I use: xDocSize

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanx, that helps a lot


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •