本文主要和大家分享 js中滚动鼠标加载数据的实现,希望能帮助到大家。
// 滚动请求数据
vm.queryAssetLogList = [];
var creditFlag = true, creditIndex = 1;
$('.cLogBox').scroll(function (e) {
var heightMinus = $('.cLog').height() - $('.cLogBox').scrollTop();
if (heightMinus <= 600) {
if (creditFlag) {
creditFlag = false;
creditIndex++;
// assetQueryAssetLogFun(vm.pageNum, vm.pageSize, obj.id);
assetQueryAssetLogFun(creditIndex, vm.pageSize, vm.logDetail.id, function (data) {
if (vm.queryAssetLogList.length < creditIndex * 10) {
} else {
creditFlag = true;
}
})
}
}
});
// 查询资产日志
function assetQueryAssetLogFun(pageNum, pageSize, id, succFn) {
var param = {
"pageNum": pageNum,
"pageSize": pageSize,
"id": id
};
console.log(param);
homepageService.assetQueryAssetLog(param).then(function (data) {
if (data.data.length < 10) {
creditFlag = false;
}
vm.queryAssetLogList = vm.queryAssetLogList.concat(data.data);
return succFn();
}, function (res) {
vm.queryAssetLogList = [];
})
相关推荐:
以上就是js实现滚动鼠标加载数据的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号