2014-03-27 29 views
0

我已經嘗試使用Animate element transform rotate,但在IE 6,7,8失敗!css3變換rotateY和變換的原始爲IE

這是我的代碼:

$('.button').click(function(){ 
    $('.hexagon').animate({ 
     borderSpacing: 150 
    },{ 
     step:function(now,fx){ 
      var costheta = Math.cos(now*Math.PI*2/360), 
       sintheta = Math.sin(Math.PI*2/360), 
       m11 = costheta, 
       m12 = -sintheta, 
       m21 = sintheta, 
       m22 = costheta, 
       matrix = 'M11='+m11+',M12='+m12+',M21='+m21+',M22='+m22; 
      $(this) 
      .css('transform','rotateY('+now+'deg)') 
      .css('transform-origin','100% 50%') 
      .css('filter','progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\'auto expand\','+matrix+')') 
      .css('-ms-filter','progid:DXImageTransform.Microsoft.Matrix(SizingMethod=\'auto expand\','+matrix+')'); 
     } 
    },'linear'); 
}); 

http://jsfiddle.net/UserNaN/j7sDa/

請幫幫我!

回答

0

IE8及更早版本不支持CSS變換.IE9使用-ms-transform和IE10,從不使用純變換。

See the Link

+0

假設這就是爲什麼OP添加過濾器,以動畫爲好。 – adeneo

+0

我看到[jquery.transform.js](https://github.com/louisremi/jquery.transform.js)具有很好的解決問題的能力,但不支持rotateY和transform-origin ...但是有其他解決方案嗎? – UserNaN