Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to access css3 transform rotate in IE?

How to access css3 transform rotate in IE?

Problem

Friends,

I am trying to Rotate image using css3. On w3schools i found :

-ms-transform: rotate(45deg); // IE 9 
-webkit-transform: rotate(45deg); // Safari and Chrome 
-moz-transform: rotate(45deg); // Firefox 
-o-transform: rotate(45deg); // Opera 

So i am dynamically rotating i.e. changing rotational angle using javascript. So i am able to rotate it Mozilla, Safari, Chrome browser with following code:

document.getElementById("testimg").style.MozTransform = 'rotate('+i+'deg)'; 
document.getElementById("testimg").style.WebkitTransform = 'rotate('+i+'deg)';

So can somebody tell me how to do this for IE9 & Opera???

Problem courtesy of: JMoh

Solution

It should be msTransform:

document.getElementById("testimg").style.msTransform = 'rotate('+i+'deg)'; 

http://jsfiddle.net/tEC8W/

Solution courtesy of: David

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

How to access css3 transform rotate in IE?

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×