文章目录
一. 滚动底部事件
//鼠标滚动到底部事件
$(dom).scroll(function () {
//被选中元素 滚动条位置
var scrollTop = $(this).scrollTop();
//整个dom的的高 (包括溢出)
var scrollHeight = $(this).prop('scrollHeight');
//当前窗口的高
var windowHeight = $(this).height();
console.log('scrollTop == ' + scrollTop + ', scrollHeight == ' + scrollHeight + ', windowHeight == ' + windowHeight)
if (scrollTop + windowHeight == scrollHeight) {
alert("已经到最底部了!");
}
});