let that = this;
window.addEventListener('scroll',function(){
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
let scrollTop = document.documentElement.scrollTop || window.pageYOffset;
let clientHeight = document.documentElement.clientHeight || window.innerHeight;
let scrollBottom = scrollHeight - scrollTop - clientHeight;
console.log(scrollBottom)
if(scrollBottom < 250) {
if(that.isUse) {
console.log("正在使用中")
that.isUse = false;
that.getMoreOrderScroll()
}
}
})
滚动加载原生JS参考
最新推荐文章于 2023-04-17 20:22:38 发布