Thuộc tính kiểu animationIterationCount
Ví dụ
Thay đổi thuộc tính animationIterationCount của phần tử <div>:
document.getElementById("myDIV").style.animationIterationCount = "infinite";
Hãy tự mình thử »Sự miêu tả
Thuộc tính animationIterationCount đặt hoặc trả về số lần hoạt ảnh sẽ được phát.
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ả về: | Một Chuỗi, biểu thị thuộc tính animation-iteration-count của một phần tử |
Phiên bản CSS | CSS3 |
Hỗ trợ trình duyệt
animationIterationCount
là một tính năng CSS3 (1999).
Nó được hỗ trợ đầy đủ trong tất cả các trình duyệt:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 11 |
Trang liên quan
Tham khảo CSS: thuộc tính animation-iteration-count