transitionend event
Example
Modify the
// Safari 3.1 to 6.0 code
document.getElementById("myDIV").addEventListener("webkitTransitionEnd", myFunction);
// Standard syntax
document.getElementById("myDIV").addEventListener("transitionend", myFunction);
Try it »
Definition and Usage
The transitionend event is triggered after the CSS transition completes.
Note: If the transition is removed before it completes, for example if the CSS transition-property property is removed, the transition event will not be triggered.
For more about CSS transitions, see our CSS3 transitions.
Browser support
The numbers in the table indicate the version number of the first browser to support the event.
The numbers specified for "webkit", "moz", or "o" are the version number prefixes of the first version that supports this event.
| Event | |||||
|---|---|---|---|---|---|
| transitionend | 26.0 | ||||
| 4.0 for webkitTransitionEnd | 10.0 | 16.0 | |||
| 4.0 for mozTransitionEnd | 6.1 | ||||
| 3.1 for webkitTransitionEnd | 12.1 | ||||
| 10.5 for oTransitionEnd |
Note: Only Safari versions 3.1 to 6.0 support this event, using the webkitTransitionEnd prefix.
Syntax
object.addEventListener("webkitTransitionEnd",
myScript
); // Safari 3.1 to 6.0 code
object
.addEventListener("transitionend",
myScript
); // Standard syntax
Note: Internet Explorer 8 and earlier IE versions do not support addEventListener() method.
Technical Details
| Does it support bubbling: | Yes |
|---|---|
| Is it cancelable: | Yes |
| Event type: | TransitionEvent |
Related pages
CSS Tutorial: CSS3 transitions
CSS Reference Manual: CSS3 transition property
CSS Reference Manual: CSS3 transition-property property
Event Object