class-transit
v0.1.0
Published
Add class and remove class for transition
Downloads
5
Readme
Class-transit
Make transition with css className, return cancel
function.
Usage
var transit = require('class-transit')
var classes = require('component-classes')
var cancel = transit(el, 'enter', {
active: 'enterActive',
timeout: 500,
callback: function() {
assert(classes(el).has('enter'), false)
assert(classes(el).has('enter-active'), false)
}
})
// callback would not be called if cancel got called
cancel()
API
transit(el, transitionName, option)
el
element for transitiontransitionName
transition className before transitionoption.active
[optional]active
className for transition (which contain transition property)option.timeout
[optional] timeout inms
option.callback
[optional] callback for succeed callback