登录/注册 登录
密码登录 验证码登录 忘记密码
快捷登录/注册
Upload
提交

原生js瀑布流控制加载数据

<div id="content-chunk">
</div>
<style>
#content-chunk{
    overflow: hidden;
    overflow-y: auto;
}
</style>
var contentChunk = document.querySelector('#content-chunk')
var  loading  = false
contentChunk.onscroll = function () {
    if (loading === false && contentChunk.scrollTop + contentChunk.offsetHeight >= contentChunk.scrollHeight - 100) {
       loading  = true
        getData()//读取数据
    }
}


感谢您的阅读,本文为正版软件资讯 | 阅木有原创内容,转载时请标注来源于正版软件资讯 | 阅木有和本文链接

评论