jquery 滑动加载更多

        //滑动加载
        var is_scroll=false;
        $(window).scroll(function () {
            is_scroll=true;
            //已经滚动到上面的页面高度
            var scrollTop = $(this).scrollTop();
            //页面高度
            var scrollHeight = $(document).height();
            //浏览器窗口高度
            var windowHeight = $(this).height();
            //此处是滚动条到底部时候触发的事件,在这里写要加载的数据,或者是拉动滚动条的操作
            if (scrollTop + windowHeight == scrollHeight) {
                loadpage();
            }
        });

 

posted @ 2017-06-30 14:42  还好l  阅读(196)  评论(0编辑  收藏  举报