Properti animation Style
- 上一頁 alignSelf
- 下一頁 animationDelay
- 返回上一層 Objek Style HTML DOM
Definisi dan penggunaan
animation
Properti ini adalah properti singkat untuk enam properti animasi:
- animationName
- animationDuration
- animationTimingFunction
- animationDelay
- animationIterationCount
- animationDirection
Keterangan:Semua masa waktu, tentukan Properti animationDurationJika tidak, masa durasi akan 0 dan tidak akan dimainkan.
Contoh
Menggunakan properti singkat untuk mengubah animasi elemen <div>:
document.getElementById("myDIV").style.animation = "mynewmove 4s 2";
語法
返回 animation 屬性:
object.style.animation
設定 animation 屬性:
object.style.animation = "name duration timingFunction delay iterationCount direction fillMode playState"
屬性值
值 | 描述 |
---|---|
animationName | 規定要綁定到選擇器的關鍵幀的名稱。 |
animationDuration | 規定動畫需要多少秒或毫秒才能完成。 |
animationTimingFunction | 規定動畫的速度曲線。 |
animationDelay | 規定動畫開始之前的延遲。 |
animationIterationCount | 規定動畫應該播放多少次。 |
animationDirection | 規定動畫是否應在交替循環中反向播放。 |
animationFillMode | 規定動畫在執行時間之外應用的值。 |
animationPlayState | 規定動畫是正在運行還是暫停。 |
initial | 將此屬性設定為其默認值。請參閱 initial。 |
inherit | 從其父元素繼承此屬性。請參閱 inherit。 |
技術細節
默認值: | none 0 ease 0 1 normal none running |
---|---|
返回值: | 字符串,表示元素的 animation 屬性。 |
CSS 版本: | CSS3 |
瀏覽器支持
animation
是 CSS3 (1999) 特性。
所有瀏覽器都完全支持它:
Chrome | Edge | Firefox | Safari | Opera | IE |
---|---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera | IE |
支持 | 支持 | 支持 | 支持 | 支持 | 11 |
相關頁面
CSS 參考手冊:animation 屬性
- 上一頁 alignSelf
- 下一頁 animationDelay
- 返回上一層 Objek Style HTML DOM