$(".scrollBtn").on("scroll", function () {
let scrollTop = $(this).scrollTop();//滚动条在Y轴上的滚动距离
let windowHeight = $(this)[0].clientHeight;//内容可视区域的高度
let scrollHeight = $(this)[0].scrollHeight;//内容可视区域的高度加上溢出(滚动)的距离
if ((scrollTop + windowHeight) >= scrollHeight) {
console.log("到达底部!")
);
}
});
js简单实现滚动条到达底部加载数据流
最新推荐文章于 2023-08-18 23:40:12 发布