2013-05-17 47 views
0

我試圖動畫一個對象並同時旋轉。 我正在使用http://code.google.com/p/jqueryrotate/ 旋轉轉換不起作用。jquery animate旋轉同步

$("#square") 
.animate({top: "300px",left:"200px"},{duration:1800,queue: false}) 
.rotate({ angle:0,animateTo:-45,duration:1800 }); 

我想要做的另一件事是有延時旋轉:您的js文件

$("#square") 
.animate({top: "300px",left:"200px"},{duration:1800,queue: false}) 
.delay(500) 
.rotate({ angle:0,animateTo:-45,duration:1800 }); 
+0

[鏈接] http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html有alook在這個網站 –

回答

0

檢查是否正確添加。我只是測試你的代碼,它工作正常。

<script type="text/javascript" src="http://jqueryrotate.googlecode.com/svn/trunk/jQueryRotate.js"></script> 
<img src="https://www.google.com/images/srpr/logo3w.png" id="image"> 

請參閱http://jsfiddle.net/RwEme/5098/

+0

沒有,它不起作用。因爲我想讓圖像移動並同時旋轉 – hanskait

0

這裏,這可能幫助你的連續旋轉。

http://jsfiddle.net/xw89p/

var rotation = function(){ 
    $("#image").rotate({ 
     angle:0, 
     animateTo:360, 
     callback: rotation, 
     easing: function (x,t,b,c,d){  // t: current time, b: begInnIng value, 
    c: change  In value, d: duration 
      return c*(t/d)+b; 
     } 
    }); 
} 
rotation();