Http://www.cnblogs.com/piuba/archive/2013/01/06/2847295.html
The jquery (window). Height () represents the size of the currently visible area, and jquery (document). Height () represents the height of the entire document, and is used visually.
Note the jquery (window) When the browser window size changes (such as maximizing or pulling out the windows). Height () changes, but jquery (document). Height () is unchanged.
$ (document). ScrollTop () Gets the distance of the vertical scroll, which is the distance from the top of the window to the top of the page
$ (document). ScrollLeft () This is the distance
to get the horizontal scroll bar To get the top only need to get to scrolltop () ==0 is the top.
to get the bottom, just get scrolltop () >=$ (document). Height ()-$ (window). Height () you will know that you have scrolled to the end
of $ (document). Height () //is the height of the entire page
$ (window). Height () //is to get the current That's the height of the page that you can see in your browser. this size will change when you zoom in on the browser window and the document is different according to the English should also be able to understand it
yourself to do an experiment to know the
$ (document) . Scroll (function () {
$ ("#lb"). Text ($ (document). ScrollTop ());
<span id= "lb" style= "top:100px;left:100px;position:fixed;" ></span><!--a fixed span marker to scroll for easy viewing-->