This article describes how to get the height of a webpage by js, such as the visible area, body, and screen resolution. For details, refer to the visible area width of the webpage: document. body. clientWidth.
Visible area height: document. body. clientHeight
Visible area width of the webpage: document. body. offsetWidth (including the width of the edge)
Visible area height of the webpage: document. body. offsetHeight (including the height of the edge)
Webpage text width: document. body. scrollWidth
Webpage text height: document. body. scrollHeight
The height of the page to be rolled: document. body. scrollTop
Left: document. body. scrollLeft
Page body: window. screenTop
Page body part left: window. screenLeft
Screen Resolution height: window. screen. height
Screen Resolution width: window. screen. width
Available screen workspace Height: window. screen. availHeight
Available workspace width: window. screen. availWidth
Because you can't remember this all the time, you should be able to remember it after reading it.
With this, I can dynamically load the image code.
The Code is as follows:
Document. onmousewheel = function (){
Var scrollTop = document.doc umentElement. scrollTop | document. body. scrollTop;
Var hght = document. body. scrollHeight;
If (scrollTop + document.doc umentElement. clientHeight> = hght ){
/* Write the image loading code here */
}