滚动到一定高度:

$(window).scroll(function(){
        var scrollTop = $(document).scrollTop();
        if (scrollTop >= 2000 && scrollTop <= 3000) {
            //alert('高度达到 2000px-3000px之间了!');
        }
    });

 // 滚动到底部

var $window = $(window);
var $document = $(document);
$window.scroll(function () {
    if ($document.scrollTop() + $window.height() >= $document.height()) {
        //滚动到页面底部了
    } else {
        //还未到底部
    }
});

 

posted on 2018-04-19 10:30  邢帅杰  阅读(140)  评论(0编辑  收藏  举报