此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。

AnimationEvent

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015年9月⁩.

AnimationEvent 介面表示提供與動畫相關訊息的事件。

Event AnimationEvent

建構子

AnimationEvent()

使用給定的參數建立一個 AnimationEvent 事件。

實例屬性

也繼承自其父 Event 的屬性

AnimationEvent.animationName Read only

包含產生動畫的 animation-name 值的字串。

AnimationEvent.elapsedTime Read only

一個 float,表示此事件觸發時動畫已執行的時間(以秒為單位),不包括動畫暫停的時間。對於 animationstart 事件,elapsedTime0.0,除非 animation-delay 有負值,此時事件將以 (-1 * delay)elapsedTime 值觸發。

AnimationEvent.pseudoElement Read only

一個以 '::' 開頭的字串,包含動畫運行的偽元素名稱。如果動畫不是運行在偽元素上,而是運行在元素上,則為空字串:''

實例方法

繼承自其父 Event 的方法

規範

Specification
CSS Animations Level 1
# interface-animationevent

瀏覽器相容性

參見