JS judges whether it has reached the bottom of the page

$(window).scroll(function(){
    
    
var scrollTop=$(this).scrollTop();
var scrollHeight=$(document).height();
var windowHeight=$(this).height();
if(scrollTop+windowHeight==scrollHeight){
    
    
alert("到底了!");
}
 
});

Guess you like

Origin blog.csdn.net/qq_41353397/article/details/112759802