jquery动画旋转同时

时间:2013-05-17 02:03:06

标签: jquery rotation jquery-animate simultaneous

我正在尝试为对象设置动画并同时旋转。 我正在使用http://code.google.com/p/jqueryrotate/ 旋转过渡不起作用。

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

我想做的另一件事是延迟轮换:

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

2 个答案:

答案 0 :(得分:0)

检查您的js文件是否正确添加。我刚刚测试了你的代码,它运行正常。

<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/

答案 1 :(得分: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();
相关问题