Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chipbell4/inertia.js
A simple JQuery plugin for inertia
https://github.com/chipbell4/inertia.js
Last synced: 9 days ago
JSON representation
A simple JQuery plugin for inertia
- Host: GitHub
- URL: https://github.com/chipbell4/inertia.js
- Owner: chipbell4
- Created: 2013-01-17T23:12:12.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-17T23:52:54.000Z (almost 12 years ago)
- Last Synced: 2024-04-14T18:27:15.410Z (7 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Inertia.js
==========A simple JQuery plugin for inertia. Simply run $.inertia on the element you want to
listen for drags, and the plugin does the rest. Currenly only has mouse support (not
touch, alas).The plugin takes four optional values for the plugin: A maximum scroll velocity
allowed (in pixels per second), a falloff rate for inertia (kind of like an inverse
mass function, bounded between 0 and 1. 0 means an instant falloff, 1 means no
falloff. The value is in energy lost per second), a callback function for velocity
reporting, and refresh rate which tells
how often the refresh function is called (in milliseconds).The callback function you provide will be called with an object passed to it. This
object will contain two values: xVelocity and yVelocity, which (obviously) give the
current velocity that the item is feeling.See the sample html file for usage.
Cheers.