find page length

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • finerrecliner@gmail.com

    find page length

    is there a function in JavaScript to find the total height of your
    page? this value should INCLUDE the unseen space you have to scroll
    down to see.

    The Ypageoffset function seems to be close to what i want. but i want
    the value when the scroll bar is at the bottom of the page at load
    time, instead of waiting for the user to scroll down themselves.

    any ideas? thanks.

  • ASM

    #2
    Re: find page length

    finerrecliner@g mail.com a écrit :
    is there a function in JavaScript to find the total height of your
    page? this value should INCLUDE the unseen space you have to scroll
    down to see.
    >
    The Ypageoffset function seems to be close to what i want. but i want
    the value when the scroll bar is at the bottom of the page at load
    time, instead of waiting for the user to scroll down themselves.
    >
    any ideas? thanks.
    an anchor in bottom of page ?

    Comment

    • Stephen Chalmers

      #3
      Re: find page length


      finerrecliner@g mail.com wrote:
      i want
      the value when the scroll bar is at the bottom of the page at load
      time, instead of waiting for the user to scroll down themselves.
      It sounds like you want to know the page's maximum displacement. If so,
      this is the way that I have done it in the past.
      Instead of calculating from a range of properties, it attempts to
      scroll down 10 Megapixels, then it reads the actual displacement before
      scrolling back to the top.
      Call it on load or later:

      <SCRIPT type='text/javascript'>
      function getScrollHeight ()
      {
      var maxDisplacement =0;

      window.scrollTo (0,10000000);

      if( typeof self.pageYOffse t!='undefined' )
      maxDisplacement =self.pageYOffs et;
      else
      if( document.compat Mode && document.compat Mode != 'BackCompat' )
      maxDisplacement =document.docum entElement.scro llTop;
      else
      if( document.body && typeof(document .body.scrollTop )!='undefined' )
      maxDisplacement =document.body. scrollTop;

      window.scrollTo (0,0);

      return maxDisplacement ;
      }

      window.onload=f unction(){alert (getScrollHeigh t())}
      </SCRIPT>

      Comment

      • TheBagbournes

        #4
        Re: find page length

        finerrecliner@g mail.com wrote:
        is there a function in JavaScript to find the total height of your
        page? this value should INCLUDE the unseen space you have to scroll
        down to see.
        >
        The Ypageoffset function seems to be close to what i want. but i want
        the value when the scroll bar is at the bottom of the page at load
        time, instead of waiting for the user to scroll down themselves.
        Measure, monetize, advertise and improve your apps with Yahoo tools. Join the 200,000 developers using Yahoo tools to build their app businesses.

        Comment

        Working...