Cross-browser transtionend event listener for Ember apps.
npm install ember-transition-end
import onTransitionEnd from 'ember-transition-end/utils/on-transition-end';
const element = document.querySelector('#foo');
onTransitionEnd(element, () => {
// Do something...
}, { transitionProperty: 'all', once: true });
Ordered by position:
element
type: HTMLElement
The target element to listen when the animation ends.
callback
type: Function
The callback executed each time the animation ends.
options
type: Object
List of options to configure listener:
Property | Type | Default | Description |
---|---|---|---|
transitionProperty |
String |
all |
CSS Transition Property. |
once |
Boolean |
false |
Trigger listener only once. |
onlyTarget |
Boolean |
false |
Only listen for transitions on target element. |
It returns a removeEventListener
callback to be used to remove event listener.
import onTransitionEnd from 'ember-transition-end/utils/on-transition-end';
const element = document.querySelector('#foo');
const removeEventListener = onTransitionEnd(element, () => {
// Do something...
});
// remove event listener
removeEventListener();
If you want to contribute to this addon, please read the CONTRIBUTING.md.
We use SemVer for versioning. For the versions available, see the tags on this repository.
See the list of contributors who participated in this project.
This project is licensed under the MIT License.