AnimationEvent

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

AnimationEvent 接口表示提供与动画相关的信息的事件。

Event AnimationEvent

Properties

属性继承其父级Event.

AnimationEvent.animationName 只读

Is a DOMString containing the value of the animation-name CSS property associated with the transition.

AnimationEvent.elapsedTime (en-US) 只读

Is a float 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).

AnimationEvent.pseudoElement (en-US) 只读

Is a DOMString, starting 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: ''.

Constructor

AnimationEvent()

Creates an AnimationEvent event with the given parameters.

Methods

Also inherits methods from its parent Event.

AnimationEvent.initAnimationEvent() (en-US) 非标准 已弃用

Initializes a AnimationEvent created using the deprecated Document.createEvent("AnimationEvent") method.

Specifications

Specification
CSS Animations Level 1
# interface-animationevent

Browser compatibility

BCD tables only load in the browser

See also