我尝试在ie中旋转元素,所以我使用矩阵滤镜,html:
<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>
然后添加过滤器:
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;
然后旋转div,但图像周围有黑色轮廓。
请参阅: