此頁面由社群從英文翻譯而來。了解更多並加入 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 介面表示提供與動畫相關訊息的事件。
建構子
AnimationEvent()-
使用給定的參數建立一個
AnimationEvent事件。
實例屬性
也繼承自其父 Event 的屬性。
AnimationEvent.animationNameRead only-
包含產生動畫的
animation-name值的字串。 AnimationEvent.elapsedTimeRead only-
一個
float,表示此事件觸發時動畫已執行的時間(以秒為單位),不包括動畫暫停的時間。對於animationstart事件,elapsedTime為0.0,除非animation-delay有負值,此時事件將以(-1 * delay)的elapsedTime值觸發。 AnimationEvent.pseudoElementRead only-
一個以
'::'開頭的字串,包含動畫運行的偽元素名稱。如果動畫不是運行在偽元素上,而是運行在元素上,則為空字串:''。
實例方法
繼承自其父 Event 的方法。
規範
| Specification |
|---|
| CSS Animations Level 1> # interface-animationevent> |
瀏覽器相容性
Enable JavaScript to view this browser compatibility table.