Now many sites for a better user experience, then will preload a portion of the content, wait until the scroll bar down to the bottom of the time, and then use AJAX or other technology to request more content, so that the user experience of the Web page is better, then this is how to do it? Now here's an idea to come out ...
$ (function () {
The idea is: if the content area is less than or equal to the height of the visible area and the scroll bar, then load ...
$ (window). Scroll (function () {
Document Height
var docheight = $ (document). Height ();
Window viewable area height
var rollheight = $ (window). Height ();
Window scroll bar height
var scrheight = $ (window). scrolltop ();
//If the content area is less than or equal to the height of the visible area and the scroll bar, then load ...
if (Docheight <= (rollheight+scrheight)) {
The other code you want to execute ...
Alert (1);
};
});
});