-1

我想检测我是否在页面底部。这适用于任何浏览器 - 但不适用于 iPhone。

if ($(window).scrollTop() == ($(document).height() - $(window).height())){
alert('on bottom'); 
}

我做错了什么?

4

1 回答 1

0

试试这个:

$(window).scroll(function () { 
   if($(window).scrollTop() + $(window).height() >= $(document).height()){
       alert('on bottom'); 
   }
});
于 2012-06-26T08:34:27.703 回答