3

这是我的代码:

/* Tile colour rotation */
/*tile 1 */
@-webkit-keyframes bwe1 {
0% {background-color: #39f;}
15% {background-color: #8bc5d1;}
30% {background-color: #f8cb4a;}
45% {background-color: #95b850;}
60% {background-color: #944893;}
75% {background-color: #c71f00;}
90% {background-color: #bdb280;}
100% {background-color: #39f;}
}
@-moz-keyframes bwe1 {
0% {background-color: #39f;}
15% {background-color: #8bc5d1;}
30% {background-color: #f8cb4a;}
45% {background-color: #95b850;}
60% {background-color: #944893;}
75% {background-color: #c71f00;}
90% {background-color: #bdb280;}
100% {background-color: #39f;}
}

/* Colour changing tiles */
.metro-layout .cycle1 {-webkit-animation: bwe1 20s infinite alternate linear;   -moz-animation: bwe1 20s infinite alternate linear; }

这是我用来定义颜色旋转动画的两段代码,但它在 IE10 中不起作用。然而,它可以在 Firefox、Safari 和 Chrome 中运行......

请帮忙!

4

1 回答 1

3

you should also define

-ms-animation: ...

and

@-ms-keyframes bwe1 { ... }

Since -webkit- and -moz- are vendor specific prefixes which IE simply ignores.

Note that you should also define the unprefixed version (animation, @keyframes) of your code for newer browsers, like latest Firefox versions.

于 2013-10-22T09:42:11.190 回答