Wednesday 27 January 2010

jQuery.scrollTop( )

Gets the scroll top offset of the first matched element. This method works for both visible and hidden elements.

The vertical scroll position is the same as the number of pixels that are hidden from view above the scrollable area. If the scroll bar is at the very top, or if the element is not scrollable, this number will be 0.

$(window).scrollTop() will give vertical scroll position of the current window.

No comments:

Post a Comment