Changing the animationIterationCount property of a <div> element:
document.getElementById("myDIV").style.animationIterationCount = "infinite";
Try it Yourself »
The animationIterationCount property sets or returns how many times an animation should be played.
Return the animationIterationCount property:
object.style.animationIterationCount
Set the animationIterationCount property:
object.style.animationIterationCount = "
number|infinite|initial|inherit"
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 |
Default Value: | 1 |
---|---|
Return Value: | A String, representing the animation-iteration-count property of an element |
CSS Version | CSS3 |
animationIterationCount
is a CSS3 (1999) feature.
It is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 11 |
CSS reference: animation-iteration-count property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!