I'm currently listening for scrollevents in jQuery, using the following code:
$(window).on('wheel', function(e) {
var delta = e.originalEvent.deltaY;
if (delta > 0) //do something
else //do something else
});
The issue I'm having is that when the user scrolls, lots of wheel
events are fired.
I want each time the user scrolls to only process the first scroll event.
I.E.: I only want to process the first wheel
event and then stop listening/processing them until the user stops scrolling. At this point I want to start listening again so I can handle the next scroll.
I've seen mousewheel DOMMouseScroll
used rather than .on('wheel')
but don't know enough about the differences to know if that could help.
Cheers, James