CSS animation-iteration-countคุณสมบัติ
ตัวอย่าง
เล่นแอนิเมชั่นสองครั้ง:
div {
animation-iteration-count: 2;
}
ตัวอย่าง "ลองใช้เอง" เพิ่มเติมด้านล่าง
ความหมายและการใช้งาน
คุณสมบัติanimation-iteration-count
ระบุจำนวนครั้งที่ควรเล่นแอนิเมชั่น
ค่าเริ่มต้น: | 1 |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS3 |
ไวยากรณ์ JavaScript: | วัตถุ .style.animationIterationCount="infinite" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
ตัวเลขตามด้วย -webkit-, -moz- หรือ -o- ระบุเวอร์ชันแรกที่ทำงานกับคำนำหน้า
Property | |||||
---|---|---|---|---|---|
animation-iteration-count | 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-iteration-count: number|infinite|initial|inherit;
มูลค่าทรัพย์สิน
Value | Description | Play it |
---|---|---|
number | A number that defines how many times an animation should be played. Default value is 1 | |
infinite | Specifies that the animation should be played infinite times (for ever) | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
เล่นแอนิเมชั่นตลอดไป:
div {
animation-iteration-count: infinite;
}
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: ภาพเคลื่อนไหว CSS
การอ้างอิง HTML DOM: คุณสมบัติแอนิเมชั่นIterationCount