proper-on-transition-end
Cross-browser transitionend
event listener.
This module is based on on-transition-end, which no longer seems to be maintained and is not working properly. Also, it automatically infers the timeout based on the transition duration.
Installation
$ npm install proper-on-transition-end
Usage
;// orconst onTransitionEnd = windowonTransitionEnd; const cancelOnTransitionEnd =
element
: The element that is transitioning.options
: You can pass a few options here:timeout
: This is automatically calculated for you, based on the longest transition of the element, usinglongest-transition
. Still, you can override that and pass thetimeout
in milliseconds.gracePeriod
: There is an implicit grace period of100
milliseconds before the event times out, but you can tweak it using this option.
callback
: The callback that is called when the transition ends.
Calling cancelOnTransitionEnd
will remove the listener and cleanup the timers.
Tests
$ npm test
$ npm test-cov
to get coverage report
License
Released under the MIT License.