views:

34

answers:

2

Hi,

I'd like to do some fancy jQuery stuff when the user scrolled the page. But I have no idea how to tackle this problem, since there is online the scroll() method.

Any ideas?

+1  A: 

Just an idea, you can try and make the scroll() have a time-out that gets overwritten each times the user scrolls. That way, when he stops after a certain amount of miliseconds your script is being run, but if he scrolls in the meantime the counter will start over again and the script will wait until he is done scrolling again.

I'm not sure if this is a good solution, but I don't think there's an actual event for 'stopped scrolling'

Litso
A: 

There is no such event as 'scrollEnd'. I recommend that you check the value returned by scroll() every once in a while (say, 200ms) using setInterval, and record the delta between the current and the previous value. If the delta becomes zero, you can use it as your event.

David Parunakian