2024年08月01日 建站教程
$(window).scroll(function(){
var scrollTop = $(this).scrollTop();
var scrollHeight = $(document).height();
var windowHeight = $(this).height();
if(scrollTop + windowHeight == scrollHeight){
console.log("我已经到底!");
}
});
scrollTop:滚动条在Y轴上的滚动距离。
clientHeight:内容可视区域的高度。
scrollHeight:内容可视区域的高度加上溢出的距离。
本文链接:http://so.lmcjl.com/news/9710/