An AngularJS directive for cross-browser mouse wheel support using the small and standalone Hamster.js library.
The event callback receives 3 extra arguments which are the normalized “deltas” of the mouse wheel.
msd-wheel="myFunction($event, $delta, $deltaX, $deltaY)"
No jQuery required, only Hamster.js. Tested in these core browsers.
- Plain wheel() with a function passed in, does not prevent default. (Also logs the value of pageX and pageY event properties.)
- Should prevent the default action.
- Should not log an event.
- Has two handlers.
- Is like 2. but has children. The children should not scroll until mousing over them.
- Is like 5. but should not scroll children or parents.
- Is like 6. but has no children. It will propagate the event and scroll 6. as well.