I have the following jQuery extension:
(function ($) { //jQuery plugin extension
jQuery.fn.rotate = function(degree, maxDegree) {
this.css({ WebkitTransform: 'rotate(' + degree + 'deg)'});
this.css({ '-moz-transform': 'rotate(' + degree + 'deg)'});
// Animate rotation with a recursive call
rotation = setInterval(function() {
if (degree < (maxDegree/2)) {
$(this).rotate(++degree);
} else {
clearInterval(rotation);
}
},5);
};
}(jQuery));
And I'm calling it like this:
$('#test').live('mouseover',function() {
$(this).rotate(0, 360);
});
But it doesn't fire, here is a JSFiddle: http://jsfiddle.net/neuroflux/8vZqr/
( Note, the fiddle won't run because of the live() )