I have found a JSFiddle that has some great code to animate a ball - it rotates it through 360 deg. What I would like to do is have the ball constantly rotate through 360 deg - it needs to turn continuously. I have tried to achieve this but have had no success. I would be grateful for any help in adjusting this javascript.
$(document).ready(function(){
var s=$('.ball').position();
var g=s.left;
var r=$('.ball').css('margin-left');
$('.ball').css({'margin-left':'0px'});
$('.ball').css({'margin-left':''+r+''});
if(r=="0px")
{
$('.ball').css({'position':'absolute'});
$('.ball').animate({'left':''+g+'px'});
}
$('.ball').css({'transform': 'rotate(360deg)','-webkit-transform': 'rotate(360deg)','-moz-transform': 'rotate(360deg)'});
});
This is the JSFiddle I found http://jsfiddle.net/996PJ/5/