0.1.0 • Published 8 years ago

detect-animation-end-helper v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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