var scrollTop = $(window).scrollTop();
var scrollHeight = $(document).height();
var windowHeight = $(window).height();
console.log(scrollTop+'/'+scrollHeight+'/'+windowHeight)
if (scrollTop + windowHeight >= scrollHeight-1) {
console.log("我到底部了")
}
if (scrollTop == 0) { //滚动到头部部执行事件
console.log("我到头部了")
}
jq判断页面滚动到底部
最新推荐文章于 2024-05-31 09:08:33 发布