2012-02-01 60 views
1

我想在完全向下滚动时向页面添加一些功能。 任何人都可以告诉是否有任何方法来查找页面是否完全使用Jquery向下滚动?使用Jquery进行页面滚动

+0

重复:http://stackoverflow.com/questions/2837741/jquery-detecting-reaching-bottom-of-scroll-doesnt-work-only-detects-the-top 这应该anwser它。 – 2012-02-01 04:36:42

回答

1

试试这个。

$(window).scroll(function(){ 
    if(($(document).height() - $(document).scrollTop()) == $(window).height()){ 
     //Scroll reached at the bottom 
    } 
}); 

Demo

1

jQuery Waypoints是这份工作的合适工具。有几个演示突出了Waypoint使用的事件驱动模型。

0

对于滚动映射,你可以使用这个;

$(window).scroll(function() { 
    var scrollVal = $(this).scrollTop(); 
    //console.log(scrollVal); 

    if (scrollVal > 0 && scrollVal < 100){ 
    //code 
    }else if (scrollVal > 100 && scrollVal < 200) { 
    //code 
    }else{ //bigger than 200px 
    //code 
    } 

});