<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()//读取数据 } }
评论