滚动到底部触发事件
$(window).on("resize scroll",function(){
var $currentWindow = $(window);var windowHeight = $currentWindow.height();//当前窗口的高度
var scrollTop = $currentWindow.scrollTop();//当前滚动条从上往下滚动的距离
var docHeight = $(document).height(); //当前文档的高度
//当 滚动条距底部的距离 + 滚动条滚动的距离 >= 文档的高度 - 窗口的高度
//换句话说:(滚动条滚动的距离 + 窗口的高度 = 文档的高度) 这个是基本的公式
if (scrollTop + windowHeight >= docHeight) {
if(_this.isLastPage == 0) {
_this.sendAjax();
}
}
});