1 Attachment(s)
why the matrix filter does not work in ie
This is a post first posted at stackoverflow,but I got no answer,so I post it here,once get an solution,I will post it at stackoverflow.
I try to rotate the elment in ie, so I use the matrix filter,html:
HTML Code:
<div id="car" style="position: absolute; width: 52px; height: 26px; -moz-transform: rotate(45deg); left: 20px; top:206px; z-index: 1000;">
<img src="http://i.stack.imgur.com/dcwtR.png" />
</div>
Then add the filter:
Code:
var a=document.getElementById("car"),b=45;
a.style.filter = 'progid:DXImageTransform.Microsoft.Matrix(sizingmethod="auto expand")';
var e = Math.cos(b * Math.PI / 180),
c = Math.sin(b * Math.PI / 180),
g = a.filters.item(0);
g.M11 = g.M22 = e;
g.M21 = -c;
g.M12 = c;
Then the div is rotated, but there are a black outline around the image.
JsFiddle
Note the black outline:Attachment 15259