更改 <div> 元素的animationIterationCount 属性:
document.getElementById("myDIV").style.animationIterationCount = "infinite";
亲自试一试 »
AnimationIterationCount 属性设置或返回动画应播放的次数。
返回animationIterationCount属性:
object.style.animationIterationCount
设置animationIterationCount属性:
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 |
默认值: | 1 |
---|---|
返回值: | 一个字符串,表示元素的动画迭代计数属性 |
CSS版本 | CSS3 |
animationIterationCount
是 CSS3 (1999) 的一项功能。
所有浏览器都完全支持它:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 11 |
CSS 参考:动画迭代计数属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!