Phong cách hoạt hìnhIterationCount Thuộc tính
Thí dụ
Thay đổi thuộc tính animationIterationCount của phần tử <div>:
document.getElementById("myDIV").style.animationIterationCount = "infinite";
Định nghĩa và Cách sử dụng
Thuộc tính animationIterationCount đặt hoặc trả về số lần một hoạt ảnh sẽ được phát.
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Các số theo sau bởi Moz chỉ định phiên bản đầu tiên hoạt động với tiền tố.
Property | |||||
---|---|---|---|---|---|
animationIterationCount | 43.0 | 79.0 | 16.0 5.0 Moz |
Not supported | 30.0 |
Cú pháp
Trả về thuộc tính animationIterationCount:
object.style.animationIterationCount
Đặt thuộc tính animationIterationCount:
object.style.animationIterationCount = "number|infinite|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
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 |
Chi tiết kỹ thuật
Giá trị mặc định: | 1 |
---|---|
Giá trị trả lại: | Một chuỗi, đại diện cho thuộc tính số lần lặp lại hoạt ảnh của một phần tử |
Phiên bản CSS | CSS3 |
Các trang liên quan
Tham chiếu CSS: thuộc tính animation-iteration-count