Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/monospaced/hamster.js

A standalone javascript library for cross-browser mouse wheel support.
https://github.com/monospaced/hamster.js

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

Hamster.js
==========

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

[See it in action](http://monospaced.github.io/hamster.js).

Usage
-----

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

```js
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](http://monospaced.github.io/obs).

Install
-------

bower install hamsterjs

Demo
----

[monospaced.github.io/hamster.js](http://monospaced.github.io/hamster.js)

Reference
---------

* [jquery-mousewheel](https://github.com/brandonaaron/jquery-mousewheel)
* [wheel event on MDN](https://developer.mozilla.org/en-US/docs/DOM/Mozilla_event_reference/wheel)