<script type= "Text/javascript" >$ (document). Ready (function () { alert ($ (window). Height ()); The browser window currently has a visible area height of alert ($ (document). Height ()); The height of the window document in the browser alert ($ (document.body). Height ());//browser Current window document body altitude alert ($ (document.body). Outerheight (True));//browser window The total height of the document body includes border padding margin Alert ($ (window). width ()); The browser window currently has a viewable area width of alert ($ (document). width ());//browser window document for image width Alert ($ (document.body). width ());//browser Current window document body height alert ($ (document.body). Outerwidth ( true);//browser window The total width of the document body includes border padding margin var win_height=$ ( window). Height (); var doc_height=$ (document). Height (); var scroll_top=$ ( Document). ScrollTop (); /* doc_height is the height of the documentation, Scroll_ Top is the height of the scroll bar above the top of the document, Window_heighT indicates the height of the window. when scroll_top = 0 o'clock, indicates that the scroll bar has reached the top of the window. when Scroll_top + window_height >= doc_height, the scroll bar has reached the bottom of the window. */ //Determines whether the scrollbar reaches the bottom of the window $ (Windows). Bind (' scroll ', function ( ) { //Bind scrolling event if ($ (document). ScrollTop () + $ (window). Height () >= $ (document). Height ()) { console.log (win_height); console.log ($ (document). ScrollTop ()); console.log (doc_height); //...... } }); }) ;</script>
jquery determines whether the scrollbar reaches the top and bottom of the window