当前位置:网站首页>Mobile terminal pull-down loading pull-down loading data

Mobile terminal pull-down loading pull-down loading data

2022-06-26 04:17:00 Never bow

Go straight to the code         Remember to introduce js 

$(window).scroll(function() {
    var scrollTop = $(this).scrollTop();
    var scrollHeight = $(document).height();
    var windowHeight = $(this).height();
    var positionValue = (scrollTop + windowHeight) - scrollHeight;
    if (positionValue >= 0 && page < max_page) {

        // perform ajax, get data 
        $.ajax({
            url:"/api/xxxxxx",
            data:{
                'page':1,
                'limit':10,
                'type':'ajax',
            },
            type:'post',
            dataType:"json",
            success:function (res) {
                console.log(res);
            }
        })
    }
});

 

 

 

原网站

版权声明
本文为[Never bow]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180536198774.html