Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/monospaced/hamster.js
- Owner: monospaced
- Created: 2013-03-21T14:52:29.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-03-31T10:33:09.000Z (over 4 years ago)
- Last Synced: 2024-10-29T20:57:18.290Z (about 2 months ago)
- Language: HTML
- Homepage: http://monospaced.github.io/hamster.js
- Size: 23.4 KB
- Stars: 179
- Watchers: 5
- Forks: 29
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
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)