这个 JSFiddle包含一个 CSS 动画,适用于 Chrome、Firefox 和 Safari,但不适用于 IE 10。我知道 IE 10不需要 前缀,所以-ms-
不可能。我看不出有什么问题:
@keyframes snapVertical {
0% { background-position: 0 0; }
16% { background-position: 0 0; }
21% { background-position: 0 -136px; }
37% { background-position: 0 -136px; }
42% { background-position: 0 -272px; }
58% { background-position: 0 -272px; }
63% { background-position: 0 -136px; }
79% { background-position: 0 -136px; }
84% { background-position: 0 0; }
100% { background-position: 0 0; }
}
.animation-snap-vertical {
animation: snapVertical 4s cubic-bezier(0.165, 0.840, 0.440, 1.000) 0s infinite;
}
为什么这在 IE 10 中不起作用?
编辑
为什么水平的有效,但垂直的(小提琴)无效?
水平动画:
@keyframes snapHorizontal {
0% { background-position: 0 0; }
16% { background-position: 0 0; }
21% { background-position: -176px 0; }
37% { background-position: -176px 0; }
42% { background-position: -352px 0; }
58% { background-position: -352px 0; }
63% { background-position: -176px 0; }
79% { background-position: -176px 0;}
84% { background-position: 0 0; }
100% { background-position: 0 0; }
}
.animation-snap-horizontal {
animation: snapHorizontal 4s cubic-bezier(0.165, 0.840, 0.440, 1.000) 0s infinite;
}