AnimationEvent

Baseline Widely available

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

實驗性質: 這是一個實驗中的功能
此功能在某些瀏覽器尚在開發中,請參考兼容表格以得到不同瀏覽器用的前輟。

摘要

AnimationEvent 介面表現提供動畫相關資訊的事件。

Event AnimationEvent

性能

另外從其父 Event 繼承屬性

AnimationEvent.animationName Read only

是一個DOMString包含的值 animation-name CSS 屬性與過渡有關。

AnimationEvent.elapsedTime Read only

是一個float給予時間的動畫已經運行,以秒為單位,當該事件燒製,不含動畫被暫停的任何時間量。為一個"animationstart"事件,elapsedTime0.0,除非有一個負值animation-delay,在這種情況下,該事件將與燒製elapsedTime含有 (-1 * delay)

AnimationEvent.pseudoElement Read only

是一個DOMString,從"::",包含的名字虛擬元素的動畫運行。如果動畫上不偽元素,但該元素,一個空字符串上運行:''。

構造函數

AnimationEvent()

創建一個AnimationEvent事件具有給定參數。

方法

同時繼承其父事件方法

AnimationEvent.initAnimationEvent() Non-standard 已棄用

初始化AnimationEvent 使用過時的創建 Document.createEvent("AnimationEvent") 方法。

規範

Specification
CSS Animations Level 1
# interface-animationevent

瀏覽器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
AnimationEvent
AnimationEvent() constructor
animationName
elapsedTime
pseudoElement

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.

另請參見