คุณสมบัติCSS ภาพเคลื่อนไหวล่าช้า
ตัวอย่าง
เริ่มแอนิเมชั่นหลังจาก 2 วินาที:
div {
animation-delay: 2s;
}
ตัวอย่าง "ลองใช้เอง" เพิ่มเติมด้านล่าง
ความหมายและการใช้งาน
คุณสมบัติระบุ การanimation-delay
หน่วงเวลาสำหรับการเริ่มแอนิเมชัน
ค่าความล่าช้าของภาพเคลื่อนไหวถูกกำหนดเป็นวินาที (s) หรือมิลลิวินาที (ms)
ค่าเริ่มต้น: | 0s |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS3 |
ไวยากรณ์ JavaScript: | วัตถุ .style.animationDelay="1s" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
ตัวเลขตามด้วย -webkit-, -moz- หรือ -o- ระบุเวอร์ชันแรกที่ทำงานกับคำนำหน้า
Property | |||||
---|---|---|---|---|---|
animation-delay | 43.0 4.0 -webkit- |
10.0 | 16.0 5.0 -moz- |
9.0 4.0 -webkit- |
30.0 15.0 -webkit- 12.0 -o- |
ไวยากรณ์ CSS
animation-delay: time|initial|inherit;
มูลค่าทรัพย์สิน
Value | Description | Play it |
---|---|---|
time | Optional. Defines the number of seconds (s) or milliseconds (ms) to wait before the animation will start. Default value is 0. Negative values are allowed. If you use negative values, the animation will start as if it had already been playing for N seconds/milliseconds. | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
การใช้ค่าลบ ที่นี่ แอนิเมชั่นจะเริ่มราวกับว่ามันได้เล่นไปแล้ว 2 วินาที:
div {
animation-delay: -2s;
}
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: ภาพเคลื่อนไหว CSS
การอ้างอิง HTML DOM: คุณสมบัติ animationDelay