您应该检查steps()
CSS 关键帧中的选项。
这是一个我没有测试过的例子......只是一个使用的演示steps()
......更多细节在这里:使用 CSS 动画的步骤()。
#loader{
border: 2px black solid;
width: 800px;
height: 480px;
background: url('http://i.imgur.com/krQPw.png?1');
background-position: 0px 0px;
background-repeat: no-repeat;
-webkit-animation: play .8s steps(10) infinite;
-moz-animation: play .8s steps(10) infinite;
-ms-animation: play .8s steps(10) infinite;
-o-animation: play .8s steps(10) infinite;
animation: play .8s steps(10) infinite;
}
@-webkit-keyframes play {
from { background-position: 0px; }
to { background-position: -8800px; }
}
@-moz-keyframes play {
from { background-position: 0px; }
to { background-position: -8800px; }
}
@-ms-keyframes play {
from { background-position: 0px; }
to { background-position: -8800px; }
}
@-o-keyframes play {
from { background-position: 0px; }
to { background-position: -8800px; }
}
@keyframes play {
from { background-position: 0px; }
to { background-position: -8800px; }
}