detect-animation-end-helper
v0.1.0
Published
Detect css animation or transition end event type.
Downloads
3
Maintainers
Readme
detect-animation-end-helper
A helper script to detect the event type that fires on end when using either css animation or transition methods.
Inspired by Detecting CSS Animation Completion with JavaScript .
example
var eventType = require('detect-animation-end-helper')
var anim = document.querySelector('#anim')
var animevent = eventType() // animation is default
animevent && anim.addEventListener(animevent, function(evt) {
console.log('animation complete')
})
var trans = document.querySelector('#trans')
var transevent = eventType('transition')
transevent && trans.addEventListener(transevent, function(evt) {
console.log('transition complete')
})
install
npm install detect-animation-end-helper
license
MIT