?
This document uses PHP Chinese website manual Release
animation-iteration-count:<single-animation-iteration-count>[,<single-animation-iteration-count>]*
<single-animation-iteration-count> = infinite | <number>
默認(rèn)值:1
適用于:所有元素,包含偽對(duì)象:after和:before
繼承性:無(wú)
動(dòng)畫性:否
計(jì)算值:指定值
媒體:視覺(jué)
infinite:無(wú)限循環(huán)
<number>:指定對(duì)象動(dòng)畫的具體循環(huán)次數(shù)
如果提供多個(gè)屬性值,以逗號(hào)進(jìn)行分隔。
對(duì)應(yīng)的腳本特性為animationIterationCount。
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support | 6.0-9.0 | 2.0-4.0 | 4.0-42.0-webkit- | 6.0-8.0-webkit- | 15.0-29.0-webkit- | 6.0-8.4-webkit- | 2.1-3.0-webkit- #1 | 18.0-42.0-webkit- |
10.0+ | 5.0-15.0-moz- | 43.0+ | 9.0+ | 30.0+ | 9.0+ | 4.0-40.0-webkit- | ||
16.0+ |
在一些場(chǎng)景中會(huì)有錯(cuò)誤行為
部分瀏覽器不支持偽元素動(dòng)畫,或者支持得不夠好,盡可能不要利用偽元素來(lái)做動(dòng)畫
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>animation-iteration-count_CSS參考手冊(cè)_web前端開(kāi)發(fā)參考手冊(cè)系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> h1{font-size:16px;} div{width:100px;height:100px;padding:10px;border-radius:61px;box-shadow:0 0 10px rgba(204,102,0,.8);background:#F6D66E;background:-moz-linear-gradient(top,#fff,#F6D66E);background:-webkit-linear-gradient(top,#fff,#F6D66E);background:linear-gradient(to bottom,#fff,#F6D66E); -moz-animation:animations 1.5s ease infinite; -webkit-animation:animations 1.5s ease infinite; animation:animations 1.5s ease infinite; } @-webkit-keyframes animations{ 0%{box-shadow:0 0 10px rgba(204,102,0,.8);} 50%{box-shadow:0 0 10px rgba(204,102,0,.3);} 100%{box-shadow:0 0 10px rgba(204,102,0,.8);} } @-moz-keyframes animations{ 0%{box-shadow:0 0 10px rgba(204,102,0,.8);} 50%{box-shadow:0 0 10px rgba(204,102,0,.3);} 100%{box-shadow:0 0 10px rgba(204,102,0,.8);} } @keyframes animations{ 0%{box-shadow:0 0 10px rgba(204,102,0,.8);} 50%{box-shadow:0 0 10px rgba(204,102,0,.3);} 100%{box-shadow:0 0 10px rgba(204,102,0,.8);} } </style> </head> <body> <h1>太陽(yáng)光暈將不停的閃爍:</h1> <div></div> </body> </html>
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例