Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE10 - CSS animation not working

I have a scale animation that worked in IE10 for about a day and then stopped. I didn't make any changes and am not sure what would happen to break it.

Does anyone have any ideas? When I look in the IE dev tools it's not picking up the animation name, but is picking up all the other properties.

Here's the 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;
}
like image 676
dex3703 Avatar asked Apr 27 '12 17:04

dex3703


2 Answers

The standard syntax is supported in Internet Explorer 10 with no need for the -ms prefix on the keyframes declaration, nor on the animation-name property. In fact, IE10, like the other vendor products, supports the shorthand animation property alone as well:

@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 */
}

Fiddle: http://jsfiddle.net/ZfJ4Z/1/

like image 125
Sampson Avatar answered Nov 06 '22 17:11

Sampson


Apparently the help link I was following isn't correct. When I change it to -ms-animation: move97 0.2s, it works. This is what I had originally and it did NOT work, so I changed it to what's shown above, which did.

Help link I followed: http://msdn.microsoft.com/library/ie/hh673530.aspx

I've been told it'll be corrected.

like image 27
dex3703 Avatar answered Nov 06 '22 17:11

dex3703