npm.io
0.1.0 • Published 10 years ago

detect-animation-end-helper

Licence
MIT
Version
0.1.0
Deps
0
Vulns
0
Weekly
0
Stars
1

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

Keywords