effected.js
animation events use as Promises or callback
Installation
$ npm install effected
Usage
Example
; // start CSS3 animationelementclassList;
Functions
effected(element[, eventType][, callback])
element
HTMLElement
eventType
String
callback
Function
for animationend, transitionend or animationstart.
return Promise if not passed callback, but throw error if cannot use Promise.
values for eventType are below:
- animationstart
- add to animationstart
- animation|animationend
- add to animationend
- transition|transitionend
- add to transitionend
- any other
- add to animationend and transitionend
effected.iterated(element, callback)
element
HTMLElement
callback
Function
for animationiteration.
effected.effected
alias of effected().
effected.Promise
effected use native Promise if the browser has it. if you want to use third party Promises library, set to this property.
License
The MIT license. Please see LICENSE file.