【发布时间】:2013-10-09 09:33:58
【问题描述】:
我目前正在使用一些 js 来检测我何时到达我正在开发的网站的页面底部。我目前正在这里用这个脚本测试 js:
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height() ){
console.log('you are at the bottom');
}
});
我的问题是它只在我到达滚动页面的顶部而不是底部时触发,这不是我想要的效果。
谁能看出它为什么不工作?
谢谢, 标记
【问题讨论】:
-
它对我有用:jsfiddle.net/Lnuze
标签: javascript jquery scroll scrolltop