Angular Mousewheel

github.com/monospaced/angular-mousewheel

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.

Tests

  1. Plain wheel() with a function passed in, does not prevent default. (Also logs the value of pageX and pageY event properties.)
  2. Should prevent the default action.
  3. Should not log an event.
  4. Has two handlers.
  5. Is like 2. but has children. The children should not scroll until mousing over them.
  6. Is like 5. but should not scroll children or parents.
  7. Is like 6. but has no children. It will propagate the event and scroll 6. as well.

Monospaced Labs

1.

2.

3.

4.

5.

6.

7.

{{ua}}