尽管在 Chrome 中,我的 CSS3 动画在 Firefox 和 Safari 中不起作用。我正在使用此代码执行动画:
html {
background:#262930 url('./images/pw_maze_black.png') no-repeat left top fixed;
background-size:cover;
animation:slides 60s;
animation-iteration-count: infinite;
-moz-animation:slides 60s;
-moz-animation-iteration-count: infinite;
-webkit-animation:slides 60s;
-webkit-animation-iteration-count: infinite;
}
这是动画本身(对于每个浏览器):
@keyframes slides
{
0% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
6% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
12% {background:url('./images/addix/slide_bg/2.jpg') no-repeat top center;}
18% {background:url('./images/addix/slide_bg/2.jpg') no-repeat top center;}
25% {background:url('./images/addix/slide_bg/3.jpg') no-repeat top center;}
31% {background:url('./images/addix/slide_bg/3.jpg') no-repeat top center;}
37% {background:url('./images/addix/slide_bg/4.jpg') no-repeat top center;}
43% {background:url('./images/addix/slide_bg/4.jpg') no-repeat top center;}
50% {background:url('./images/addix/slide_bg/5.jpg') no-repeat top center;}
56% {background:url('./images/addix/slide_bg/5.jpg') no-repeat top center;}
62% {background:url('./images/addix/slide_bg/6.jpg') no-repeat top center;}
68% {background:url('./images/addix/slide_bg/6.jpg') no-repeat top center;}
75% {background:url('./images/addix/slide_bg/7.jpg') no-repeat top center;}
81% {background:url('./images/addix/slide_bg/7.jpg') no-repeat top center;}
87% {background:url('./images/addix/slide_bg/8.jpg') no-repeat top center;}
93% {background:url('./images/addix/slide_bg/8.jpg') no-repeat top center;}
100% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
}
@-moz-keyframes slides /* Firefox */
{
0% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
6% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
12% {background:url('./images/addix/slide_bg/2.jpg') no-repeat top center;}
18% {background:url('./images/addix/slide_bg/2.jpg') no-repeat top center;}
25% {background:url('./images/addix/slide_bg/3.jpg') no-repeat top center;}
31% {background:url('./images/addix/slide_bg/3.jpg') no-repeat top center;}
37% {background:url('./images/addix/slide_bg/4.jpg') no-repeat top center;}
43% {background:url('./images/addix/slide_bg/4.jpg') no-repeat top center;}
50% {background:url('./images/addix/slide_bg/5.jpg') no-repeat top center;}
56% {background:url('./images/addix/slide_bg/5.jpg') no-repeat top center;}
62% {background:url('./images/addix/slide_bg/6.jpg') no-repeat top center;}
68% {background:url('./images/addix/slide_bg/6.jpg') no-repeat top center;}
75% {background:url('./images/addix/slide_bg/7.jpg') no-repeat top center;}
81% {background:url('./images/addix/slide_bg/7.jpg') no-repeat top center;}
87% {background:url('./images/addix/slide_bg/8.jpg') no-repeat top center;}
93% {background:url('./images/addix/slide_bg/8.jpg') no-repeat top center;}
100% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
}
@-webkit-keyframes slides /* Safari and Chrome */
{
0% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
6% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
12% {background:url('./images/addix/slide_bg/2.jpg') no-repeat top center;}
18% {background:url('./images/addix/slide_bg/2.jpg') no-repeat top center;}
25% {background:url('./images/addix/slide_bg/3.jpg') no-repeat top center;}
31% {background:url('./images/addix/slide_bg/3.jpg') no-repeat top center;}
37% {background:url('./images/addix/slide_bg/4.jpg') no-repeat top center;}
43% {background:url('./images/addix/slide_bg/4.jpg') no-repeat top center;}
50% {background:url('./images/addix/slide_bg/5.jpg') no-repeat top center;}
56% {background:url('./images/addix/slide_bg/5.jpg') no-repeat top center;}
62% {background:url('./images/addix/slide_bg/6.jpg') no-repeat top center;}
68% {background:url('./images/addix/slide_bg/6.jpg') no-repeat top center;}
75% {background:url('./images/addix/slide_bg/7.jpg') no-repeat top center;}
81% {background:url('./images/addix/slide_bg/7.jpg') no-repeat top center;}
87% {background:url('./images/addix/slide_bg/8.jpg') no-repeat top center;}
93% {background:url('./images/addix/slide_bg/8.jpg') no-repeat top center;}
100% {background:url('./images/addix/slide_bg/1.jpg') no-repeat top center;}
}
是我的错还是 Firefox 和 Safari 的错?
编辑:链接到小提琴http://jsfiddle.net/AF4Ce/1/