Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a CSS 'transform' for IE9 browsers?

An example on jsfiddle http://jsfiddle.net/chrisloughnane/T9N3h/

This example works fine in opera, chrome and firefox but I can't find a transform for IE.

Also on Firefox all animation stops when there are a lot of transforms.

http://toys.chrisloughnane.net/

Is there a better way to approach this? tia.

HTML

<div class="display"></div>

CSS

.display {
    background-image: url("http://toys.chrisloughnane.net/images/darkhand-small-50.png");
    height: 25px;
    width: 25px;
    -webkit-transition:all 400ms;   
    -moz-transition:all 400ms;
    -o-transition:all 400ms;
    transition:all 400ms; 
    position: absolute;
    top: 200px;
    left: 200px;
}

JavaScript

$(document).ready(function() {

    function getRandom(min, max) {
        return min + Math.floor(Math.random() * (max - min + 1));
    }

    function go() {

        var iCSS = ("rotate(" + getRandom(0, 359) + "deg)");

        $(".display").css({
            '-moz-transform': iCSS,
            '-o-transform': iCSS,
            '-webkit-transform': iCSS
        });

        setTimeout(go, 600);
    }

    go();

});
like image 500
chris loughnane Avatar asked Dec 29 '25 18:12

chris loughnane


1 Answers

Yes, IE9 supports CSS Transforms. You just have to add the -ms- prefix.

See the CanIUse website for more info.

It doesn't however, support Transitions, which I see in your CSS code in the question. If you need to support CSS transitions in IE9 (or earlier), you could use the CSS Sandpaper polyfill library.

like image 132
Spudley Avatar answered Jan 01 '26 11:01

Spudley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!