AnimationPlaybackEvent: AnimationPlaybackEvent() constructor
Baseline 2022
Newly available
Since September 2022, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The AnimationPlaybackEvent()
constructor of the Web Animations API returns a new AnimationPlaybackEvent
object instance.
Syntax
js
new AnimationPlaybackEvent(type)
new AnimationPlaybackEvent(type, options)
Parameters
type
-
A string with the name of the event. It is case-sensitive and browsers set it to
cancel
,finish
, orremove
. options
Optional-
An object that, in addition of the properties defined in
Event()
, has the following properties:detail
Optional-
An event-dependent value associated with the event. Defaults to
null
.
Return value
A new AnimationPlaybackEvent
object.
Specifications
Specification |
---|
Web Animations # dom-animationplaybackevent-animationplaybackevent |
Browser compatibility
BCD tables only load in the browser