樣式 animationDelay 屬性
示例
更改 <div> 元素的 animationDelay 屬性
document.getElementById("myDIV").style.animationDelay = "1s";
自己動手試一試 »
描述
animationDelay 屬性定義了動畫何時開始。
animationDelay 的值以秒 (s) 或毫秒 (ms) 為單位。
提示:允許使用負值,-2s 表示動畫立即開始,但從動畫的第二秒開始。
語法
返回 animationDelay 屬性
object.style.animationDelay
設定 animationDelay 屬性
object.style.animationDelay = "time|initial|inherit"
屬性值
值 | 描述 |
---|---|
time | 可選。定義動畫開始前等待的秒數或毫秒數。預設值為 0 |
initial | 將此屬性設定為其預設值。閱讀關於 initial |
inherit | 從其父元素繼承此屬性。閱讀關於 inherit |
技術詳情
預設值 | 0 |
---|---|
返回值 | 一個字串,表示元素的 animation-delay 屬性 |
CSS 版本 | CSS3 |
瀏覽器支援
animationDelay
是 CSS3 (1999) 功能。
所有瀏覽器都完全支援。
Chrome | Edge | Firefox | Safari | Opera | IE |
是 | 是 | 是 | 是 | 是 | 11 |
相關頁面
CSS 參考: animation-delay 屬性