jquery 滑动加载


<script src="../jquery-1.11.3.min.js"></script>
<script>
    $(window).scroll(   // 滑动加载更多数据
            function() {
                var scrollTop = $(this).scrollTop();
                var scrollHeight = $(document).height();
                var windowHeight = $(this).height();
                if (scrollTop + windowHeight == scrollHeight) {
// 此处是滚动条到底部时候触发的事件,在这里写要加载的数据,或者是拉动滚动条的操作
                    alert(1)
                }
            });
</script>
posted @ 2017-04-25 16:55  太空刘  阅读(482)  评论(0编辑  收藏  举报