Ajax滚动加载数据

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huangyuxin_/article/details/82782503
   var count = 12,a = 0;
   $(window).scroll(function () {
        var scrollTop = $(this).scrollTop();
        var scrollHeight = $(document).height();
        var windowHeight = $(this).height();
        if (scrollTop + windowHeight == scrollHeight) {
        a = a + 1;
        count = count * a;
            $.post("ajaxData",{count:count},function(data){
                //操作DOM
            })
        }
    });

猜你喜欢

转载自blog.csdn.net/huangyuxin_/article/details/82782503