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(...

dda
  • 5,760
  • 2
  • 24
  • 34
IMUXIxD
  • 1,213
  • 4
  • 21
  • 43

1 Answers1

2

It will only trigger when you change the scroll bar.

http://jsfiddle.net/UtL2N/

Same code as OP
Steve Wellens
  • 20,326
  • 2
  • 25
  • 66