0

Looks like default easing in jQueryRotate plugin is not linear.. Image rotate with slowdown at the end of rotation. So if I use recursive function image doesn't rotate evenly.

Example:

Here is the code:

HTML:

<div id="rotate_me" style="border: 1px solid red; width: 100px; height: 100px"></div>

JS:

var rotation = function (){
   jQuery("#rotate_me").rotate({
      angle: 0,
      animateTo:360,
      duration: 1600,
      callback: rotation
   });
}
rotation();
MonkeyShoulder
  • 83
  • 4
  • 12

2 Answers2

1

I found the solution - it is to add parameter:

easing: function (x,t,b,c,d){ 
          return c*(t/d)+b;
      }

into rotate function.

Description about easing function you can see here:

What is an easing function?

Community
  • 1
  • 1
MonkeyShoulder
  • 83
  • 4
  • 12
-1

Using only CSS3 is quite simple: LIVE DEMO
might be you can find your answer in this lines?
(this one is for FF, for other br. add the -browser-specific properties)

img {
  animation-duration: 3s;
  animation-name: wowrotate;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

@keyframes wowrotate{
  from { 
     transform: rotate(0deg);
  }
  to {
     transform: rotate(360deg);
  }
}
Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313