hamsterjs

1.1.3 • Public • Published

Hamster.js

A standalone javascript library for cross-browser mouse wheel support.

See it in action.

Usage

The event callback receives 3 extra arguments which are the normalized “deltas” of the mouse wheel.

var hamster = Hamster(el);
 
hamster.wheel(function(event, delta, deltaX, deltaY){
  console.log(delta, deltaX, deltaY);
});
 
// destroy
hamster.unwheel();

Support

No jQuery or other libraries required, but an adapter for AngularJS is available.

Tested in these core browsers.

Install

bower install hamsterjs

Demo

monospaced.github.io/hamster.js

Reference

Package Sidebar

Install

npm i hamsterjs

Weekly Downloads

4,032

Version

1.1.3

License

MIT

Unpacked Size

10.2 kB

Total Files

3

Last publish

Collaborators

  • monospaced
  • pitbeast