I’m trying to get the vertical position of the browser scroll bar with javascript. I am currently using the jquery scroll() function, but I feel like the callbacks are a bit slow, and I’m wondering if there is a faster, native way to use a callback when a user scrolls in the browser. Does anyone know?
I’m trying to get the vertical position of the browser scroll bar with javascript.
Share
If you feel the callback is taking too much time to run, you could throttle it. Just keep track of the time it was last called: http://jsfiddle.net/fjjAw/.