我想检测一下我是否在页面底部。这适用于任何浏览器 - 但不适用于iPhone。
if ($(window).scrollTop() == ($(document).height() - $(window).height())){
alert('on bottom');
}
我做错了什么?
答案 0 :(得分:0)
请改为尝试:
$(window).scroll(function () {
if($(window).scrollTop() + $(window).height() >= $(document).height()){
alert('on bottom');
}
});