TransitionEvent: TransitionEvent() constructor

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2016.

The TransitionEvent() constructor returns a new TransitionEvent object, representing an event in relation with a transition.

Syntax

js
new TransitionEvent(type)
new TransitionEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers set it to transitionrun, transitionstart, transitionend, or transitioncancel.

options Optional

An object that, in addition of the properties defined in Event(), can have the following properties:

propertyName Optional

A string containing the name of the CSS property associated with the transition. It defaults to "".

elapsedTime Optional

A number giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. For an "animationstart" event, elapsedTime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedTime containing (-1 * delay). It defaults to 0.0.

pseudoElement Optional

A string, defaulting with "::", containing the name of the pseudo-element the animation runs on. If the animation doesn't run on a pseudo-element but on the element, an empty string: "". It defaults to "".

Return value

A new TransitionEvent object.

Specifications

Specification
CSS Transitions Module Level 1
# dom-transitionevent-transitionevent

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
TransitionEvent() constructor
Chrome – Full support
Chrome 27 (Release date: 2013-05-21)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 23 (Release date: 2013-08-06)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 6 (Release date: 2012-07-25)
prefix
prefix Implemented with the vendor prefix: WebKit
Safari – Full support
Safari 7 (Release date: 2013-10-22)
footnote Full support
Chrome Android – Full support
Chrome Android 27 (Release date: 2013-05-22)
footnote Full support
Firefox for Android – Full support
Firefox for Android 23 (Release date: 2013-08-06)
footnote Full support
Opera Android – Full support
Opera Android 15 (Release date: 2013-07-08)
footnote Full support
Safari on iOS – Full support
Safari on iOS 6 (Release date: 2012-09-10)
prefix
prefix Implemented with the vendor prefix: WebKit
Safari on iOS – Full support
Safari on iOS 7 (Release date: 2013-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 6 (Release date: 2012-09-10)
prefix
prefix Implemented with the vendor prefix: WebKit
WebView on iOS – Full support
WebView on iOS 7 (Release date: 2013-09-18)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also