https://github.com/digitaledgeit/js-animation-events
Bind and unbind animation events.
https://github.com/digitaledgeit/js-animation-events
Last synced: 11 days ago
JSON representation
Bind and unbind animation events.
- Host: GitHub
- URL: https://github.com/digitaledgeit/js-animation-events
- Owner: digitaledgeit
- Created: 2015-05-20T05:05:35.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-06-01T00:52:26.000Z (about 10 years ago)
- Last Synced: 2025-08-09T01:32:00.372Z (10 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# animation-events
Bind and unbind animation events.
## Installation
Component:
component install digitaledgeit/js-animation-events
## Usage
var events = require('animation-events');
var el = document.querySelector('.js-ball');
events
.bind(el, 'start', function(event) {
console.log('start', event);
})
.bind(el, 'end', function(event) {
console.log('end', event);
})
.once(el, 'iteration', function(event) {
console.log('iteration', event);
})
;
## API
### Methods
#### .supported
Get whether animations are supported by the browser.
#### .has(el)
Get whether an element has an animation applied.
#### .bind(el, event, callback)
Add a callback for an animation event (`start`, `end` or `iteration`).
#### .unbind(el, event, callback)
Remove a callback for an animation event (`start`, `end` or `iteration`).
#### .once(el, event, callback)
Add a callback for a single animation event (`start`, `end` or `iteration`).
## Building
browserify index.js -r ./index.js:animation-events > build/build.js
## Testing
mochify