my-impetus
v1.0.0
Published
Add momentum to anything. It's like iScroll, except not for scrolling. Supports mouse and touch events.
Downloads
5
Readme
Impetus.js
Add momentum to anything. It's like iScroll, except not for scrolling. Supports mouse and touch events.
Check out the demos on the home page.
Impetus will probably never support anything other than simple momentum. If you need scrolling or touch carousels or anything like that, this probably isn't the tool you're looking for.
Usage
var myImpetus = new Impetus({
source: myNode,
update: function(x, y) {
// whatever you want to do with the values
}
});
You give it an area to listen to for touch or mouse events, and it gives you the x and y values with some momentum.
Impetus will register itself as an AMD module if it's available.
Constructor Options
Methods
Browser Support
Chrome, Firefox, Safari, Opera, IE 9+, iOS, Android. Support for IE 8 can be achieved by adding a polyfill for addEventListener.