Copy codeThe Code is as follows:
$ (Document). height () // gets the height of the entire page
$ (Window). height () // gets the height of the page that the browser can see. This size will change when you zoom in the browser window, which is different from the document size.
To get the top, you only need to get scrollTop () = 0, which is the top;
To get the bottom end, you only need to get scrollTop () >=$ (document). height ()-$ (window). height () to know the end of the scroll;
Copy codeThe Code is as follows:
$ (Document). scrollTop () gets the vertical scroll distance, that is, the distance from the top of the current tumble window to the top of the entire page;
$ (Document). scrollLeft () This is the distance to obtain the horizontal scroll bar;
Example:
Copy codeThe Code is as follows:
$ (Document). scroll (function (){
$ ("# Lb"). text ($ (document). scrollTop ());
})
<Span id = "lb" style = "top: 100px; left: 100px; position: fixed;"> </span> <! -- When a fixed span mark is rolled -->