คุณสมบัติภาพเคลื่อนไหว CSS
ตัวอย่าง
ผูกแอนิเมชั่นกับองค์ประกอบ <div> โดยใช้คุณสมบัติชวเลข:
div
{
animation: mymove 5s infinite;
}
ความหมายและการใช้งาน
animation
ทรัพย์สินเป็นทรัพย์สินชวเลขสำหรับ:
- แอนิเมชั่น-ชื่อ
- แอนิเมชั่น-duration
- แอนิเมชั่น-จับเวลา-ฟังก์ชั่น
- แอนิเมชั่น-ล่าช้า
- แอนิเมชั่น-การวนซ้ำ-นับ
- แอนิเมชั่น-ทิศทาง
- แอนิเมชั่นเติมโหมด
- แอนิเมชั่นเล่นสถานะ
หมายเหตุ:ระบุ คุณสมบัติ ระยะเวลาของภาพเคลื่อนไหว เสมอ มิฉะนั้น ระยะเวลาจะเป็น 0 และจะไม่มีวันเล่น
ค่าเริ่มต้น: | ไม่มี 0 สบาย 0 1 ปกติ ไม่มีวิ่ง |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS3 |
ไวยากรณ์ JavaScript: | วัตถุ .style.animation="mymove 5s อนันต์" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
ตัวเลขตามด้วย -webkit-, -moz- หรือ -o- ระบุเวอร์ชันแรกที่ทำงานกับคำนำหน้า
Property | |||||
---|---|---|---|---|---|
animation | 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: name duration timing-function delay iteration-count
direction fill-mode play-state;
มูลค่าทรัพย์สิน
Value | Description |
---|---|
animation-name | Specifies the name of the keyframe you want to bind to the selector |
animation-duration | Specifies how many seconds or milliseconds an animation takes to complete |
animation-timing-function | Specifies the speed curve of the animation |
animation-delay | Specifies a delay before the animation will start |
animation-iteration-count | Specifies how many times an animation should be played |
animation-direction | Specifies whether or not the animation should play in reverse on alternate cycles |
animation-fill-mode | Specifies what values are applied by the animation outside the time it is executing |
animation-play-state | Specifies whether the animation is running or paused |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: ภาพเคลื่อนไหว CSS
การอ้างอิง HTML DOM: คุณสมบัติแอนิเมชั่น