0

I am trying to get the scrollTop value on scroll. In other words, the location of the scrollbar at a certain point in the page.

Why isn't this working?

$(document).scroll(function(){
    alert($(document).scrollTop());
});

It is wrapped in $(document).ready(...

4

1 回答 1

2

它只会在您更改滚动条时触发。

http://jsfiddle.net/UtL2N/

Same code as OP
于 2013-05-11T17:52:44.953 回答