0

I'm trying to animate an object and rotate simultaneosly. I'm using http://code.google.com/p/jqueryrotate/ The rotate transition doesn't work.

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

Another thing I would like to do is rotating with delay:

$("#square")
.animate({top: "300px",left:"200px"},{duration:1800,queue: false})
.delay(500)
.rotate({ angle:0,animateTo:-45,duration:1800 });
tckmn
  • 57,719
  • 27
  • 114
  • 156
hanskait
  • 45
  • 1
  • 9

2 Answers2

0

Check whether your js files added properly. I just tested your code and it works fine.

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

Please see http://jsfiddle.net/RwEme/5098/

Raji
  • 845
  • 1
  • 14
  • 22
0

Here this might help you with the continous rotation.

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();
Abhi
  • 79
  • 1
  • 3
  • 10