Home > Web Front-end > JS Tutorial > body text

js implements scrolling mouse to load data

小云云
Release: 2018-02-27 13:49:01
Original
2035 people have browsed it

This article mainly shares with you the implementation of rolling mouse loading data in js, hoping to help everyone.

// 滚动请求数据
    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 = [];
        })
Copy after login


Related recommendations:

Jquery-based rolling mouse zoom-in image effect_jquery

The above is the detailed content of js implements scrolling mouse to load data. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template