I'm simply trying to do something once the scroll position of the page reaches a certain height. However scrollTop()
is returning 0 or null
no matter how far down I scroll. This is the help function I'm using to check the scrollTop()
value:
$('body').click(function(){
var scrollPost = $(document).scrollTop();
alert(scrollPost);
});
我试着把scrollTop()
和$('body')
、$('html')
,当然还有$(window)
连接起来,但没有任何变化.
有什么主意吗?