JQuery 判断滚动条是否到底部

 1 BottomJumpPage: function () {
 2             var scrollTop = $(this).scrollTop();
 3             var scrollHeight = $(document).height();
 4             var windowHeight = $(this).height();
 5             if (scrollTop + windowHeight == scrollHeight) {  //滚动到底部执行事件
 6                     console.dir("我到底部了");
 7 
 8             }
 9             if (scrollTop == 0) {  //滚动到头部部执行事件
10             console.dir("我到头部了");
11 
12             }
13  }
$(window).scroll(BottomJumpPage);

  

原文地址:https://www.cnblogs.com/congxueda/p/5126992.html