共计 553 个字符,预计需要花费 2 分钟才能阅读完成。
document.addEventListener('touchmove', function() {
let scrollTopH = document.body.scrollTop || document.documentElement.scrollTop;
var clientHeight = document.documentElement.scrollTop === 0 ? document.body.clientHeight : document.documentElement.clientHeight;
var scrollTop = document.documentElement.scrollTop === 0 ? document.body.scrollTop : document.documentElement.scrollTop;
var scrollHeight = document.documentElement.scrollTop === 0 ? document.body.scrollHeight : document.documentElement.scrollHeight;
if (scrollTop != 0 && clientHeight + scrollTop == scrollHeight) {console.log('‘到达底部’')
}
})
正文完
发表至: javascript
2019-09-29