I'm building a custom jQuery code to allow the user to be guided through a webpage by using the mousewheel.
The code I'm building is simulair to this page: Link
Everything works fine, but the mousewheel event fires multiple times by default, making the script 'skip' complete divs and scroll down/up multiple times, instead of just once.
I need a way to limit the mousewheel to fire only once. In my quest of finding the answer I found Ben Alman's script wich uses 'debounce'.
My question here is; is there a way to debounce EVERY mousewheel event instead of debouncing it's function? So basicly telling 'mouse wheel' to fire once every 500ms, and ignore all fires that were send in that 500ms period.
How about using
setTimeout
to control the firing of events - as:Fiddle: http://jsfiddle.net/aN4hU/