kthornbloom kthornbloom - 1 year ago 105
jQuery Question

How to CONSTANTLY rotate an object with jquery?

OKAY! Here's the situation. I've got a jQuery plugin that's animating a background-image in my header to constantly scroll left-to-right. I have a .png of a wheel sitting on this header. I need to have the wheel constantly spinning with the moving background.

CSS3- Yes I could use CSS3, but then some poor soul using Internet Explorer would see a stationary wheel on a moving background which would be weird.

jQuery Plugins- This is what I'd LIKE to use, but I have yet to find one that will constantly rotate the image. Most only rotate by a certain angle when you activate it.

If anybody has any thoughts, I'd appreciate it!

Answer Source

You could try this:


    var rotation = function (){
      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;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download