TransitionEvent
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
TheTransitionEvent interface represents events providing information related totransitions.
In this article
Constructor
TransitionEvent()Creates a
TransitionEventevent with the given parameters.
Instance properties
Also inherits properties from its parentEvent.
TransitionEvent.propertyNameRead onlyA string containing the name CSS property associated with the transition.
TransitionEvent.elapsedTimeRead onlyA
floatgiving the amount of time the transition has been running, in seconds, when this event fired. This value is not affected by thetransition-delayproperty.TransitionEvent.pseudoElementRead onlyA string, starting with
::, containing the name of thepseudo-element the animation runs on. If the transition doesn't run on a pseudo-element but on the element, an empty string:''.
Types ofTransitionEvent
transitioncancelAn
Eventfired when aCSS transition has been cancelled.transitionendAn
Eventfired when aCSS transition has finished playing.transitionrunAn
Eventfired when aCSS transition is created (i.e., when it is added to a set of running transitions), though not necessarily started.transitionstartAn
Eventfired when aCSS transition has started transitioning.
Instance methods
Also inherits methods from its parentEvent.
Specifications
| Specification |
|---|
| CSS Transitions> # interface-transitionevent> |
Browser compatibility
See also
- Using CSS transitions
- CSS properties:
transition,transition-delay,transition-duration,transition-property,transition-timing-function - CSS at-rules:
@starting-style