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
  • 6,030
  • 2
  • 25
  • 34
IMUXIxD
  • 1,223
  • 5
  • 23
  • 44

1 Answers1

2

It will only trigger when you change the scroll bar.

http://jsfiddle.net/UtL2N/

Same code as OP
Steve Wellens
  • 20,506
  • 2
  • 28
  • 69