6

我有一个在 IE10 中工作了大约一天然后停止的比例动画。我没有做任何改变,也不确定会发生什么破坏它。

有没有人有任何想法?当我查看 IE 开发工具时,它没有选择动画名称,而是选择了所有其他属性。

这是CSS:

@-ms-keyframes move97
{
    0% {
        transform:scale(1,1);
        -ms-transform:scale(1,1); 
        -moz-transform:scale(1,1); 
        -webkit-transform:scale(1,1); 
        -o-transform:scale(1,1); 
    }
    50% {
        transform:scale(0.97,0.97);
        -ms-transform:scale(0.97,0.97); 
        -moz-transform:scale(0.97,0.97); 
        -webkit-transform:scale(0.97,0.97); 
        -o-transform:scale(0.97,0.97); 
    }
    100% {
        transform:scale(1,1);
        -ms-transform:scale(1,1); 
        -moz-transform:scale(1,1); 
        -webkit-transform:scale(1,1); 
        -o-transform:scale(1,1); 
    }
}

.press97
{
    -ms-animation-name: move97 0.2s; /* note MS has this different.... ugh */
    animation: move97 0.2s;
    -moz-animation: move97 0.2s; /* Firefox */
    -webkit-animation: move97 0.2s; /* Safari and Chrome */ 

    animation-timing-function: linear;
    -moz-animation-timing-function: linear; 
    -webkit-animation-timing-function: linear;
    -ms-animation-timing-function: linear;   

    animation-fill-mode: forwards;
    -webkit-animation-fill-mode: forwards;
    -moz-animation-fill-mode: forwards;
    -ms-animation-fill-mode: forwards;
}
4

2 回答 2

19

Internet Explorer 10 支持标准语法,不需要-ms关键帧声明上的前缀,也不需要animation-name属性上的前缀。事实上,IE10 和其他厂商的产品一样,animation也只支持简写属性:

@keyframes myanimation {
    0%   { color: black; }
    80%  { color: gold; transform: translate(20px,20px); }
    100% { color: black; translate(0,0); }
}

#anim {
    display: inline-block;
    animation: myanimation 5s 5; /* use myanimation 5s duration, 5 times */
}

小提琴:http: //jsfiddle.net/ZfJ4Z/1/

于 2012-06-04T14:29:46.847 回答
5

显然我关注的帮助链接不正确。当我将其更改为 -ms-animation: move97 0.2s 时,它可以工作。这是我最初拥有的,但它不起作用,所以我将其更改为上面显示的内容,它确实有效。

我关注的帮助链接:http: //msdn.microsoft.com/library/ie/hh673530.aspx

我被告知它将被纠正。

于 2012-04-27T22:43:10.967 回答