window.onLoadMore = function (cb) {
cb = cb || function () {};
const body = document.body;
$(window).on('scroll', scroll);
let flag = true;
function scroll() {
let scroll = body.getBoundingClientRect().top;
scroll = Math.abs(scroll);
//屏幕的高度
const client = $(window).height();
const h = $(document).height();
if (h <= scroll + client) {
if (!flag) return false;
flag = false;
cb(function () {
flag = true;
})
}
}
};
手机端分页代码
最新推荐文章于 2022-12-31 21:07:20 发布