亚洲区国产区激情区无码区,国产成人mv视频在线观看,国产A毛片AAAAAA,亚洲精品国产首次亮相在线

CSS 參考手冊

CSS @規(guī)則(RULES)

CSS 屬性大全

CSS3 animation-iteration-count 屬性使用方法及示例

CSS3 animation-iteration-count屬性指定動畫周期停止前,應(yīng)該播放的次數(shù)。

下表總結(jié)了此屬性的用法上下文和版本歷史記錄。

默認(rèn)值:1
適用于:所有元素::before和::after 偽元素
繼承:沒有
可動畫制作:否。請參見 動畫屬性。
版本: CSS3的新功能
JavaScript 語法:    
object    object.style.animationIterationCount=3

animation-iteration-count的使用語法

該屬性的語法如下:

animation-iteration-count: number | infinite | initial | inherit

下面的示例演示了如何使用animation-iteration-count屬性。

.box {
    width: 50px;
    height: 50px;
    background: red;
    position: relative;
    /* Chrome, Safari, Opera */
    -webkit-animation-name: moveit;
    -webkit-animation-duration: 4s;
    -webkit-animation-iteration-count: infinite;
    
    animation-name: moveit;
    animation-duration: 4s;
    animation-iteration-count: infinite;
}
 
/* Chrome, Safari, Opera */
@-webkit-keyframes moveit {
    from {left: 0;}
    to {left: 50%;}
}
 

@keyframes moveit {
    from {left: 0;}
    to {left: 50%;}
}
測試看看?/?

屬性值

下表描述了此屬性的值。

描述
number指定動畫應(yīng)重復(fù)的次數(shù)。默認(rèn)值為1。不允許使用負(fù)值。
infinite動畫將永遠(yuǎn)重復(fù),即無限次。
initial將此屬性設(shè)置為其默認(rèn)值。
inherit如果指定,則關(guān)聯(lián)元素采用其父元素animation-iteration-count屬性的計算值。

注意:您可以指定非整數(shù)值一樣0.5,0.75等玩只是一個動畫周期的一部分,例如價值0.5將播放動畫周期的一半。

瀏覽器兼容性

animation-iteration-count屬性瀏覽器的兼容性,所有主流瀏覽器均支持該屬性。

瀏覽器圖標(biāo)
  • Firefox 5+ -moz-,15 +

  • Google Chrome 4+ -webkit-

  • Internet Explorer 10+

  • Apple Safari 4+ -webkit-

  • Opera 12+ -o-,15+ -webkit-

進(jìn)一步閱讀

請參考以下教程:CSS3動畫。

相關(guān)屬性和規(guī)則:animation,animation-name,animation-durationanimation-timing-function,animation-delayanimation-direction,animation-fill-modeanimation-play-state,@keyframes。