ember-transition-end
v2.0.0
Published
Cross-browser transtionend event listener
Downloads
119
Maintainers
Readme
ember-transition-end
Information
Cross-browser transtionend event listener for Ember apps.
Installation
npm install ember-transition-end
Usage
import onTransitionEnd from 'ember-transition-end/utils/on-transition-end';
const element = document.querySelector('#foo');
onTransitionEnd(element, () => {
// Do something...
}, { transitionProperty: 'all', once: true });
Arguments
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. |
Return value
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();
Contribute
If you want to contribute to this addon, please read the CONTRIBUTING.md.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
See the list of contributors who participated in this project.
License
This project is licensed under the MIT License.