User:Sowminya Arikapudi/common.js: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) Blanked the page |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
$.fn.animateRotate = function (angle, duration, complete) { | |||
return this.each(function () { | |||
var $elem = $(this); | |||
$({ | |||
deg : 0 | |||
}).animate({ | |||
deg : angle | |||
}, { | |||
duration : duration, | |||
step : function (now) { | |||
$elem.css({ | |||
transform : 'rotate(' + now + 'deg)' | |||
}); | |||
}, | |||
complete : complete || $.noop | |||
}); | |||
}); | |||
}; |
Revision as of 20:39, 22 September 2015
$.fn.animateRotate = function (angle, duration, complete) { return this.each(function () { var $elem = $(this); $({ deg : 0 }).animate({ deg : angle }, { duration : duration, step : function (now) { $elem.css({ transform : 'rotate(' + now + 'deg)' }); }, complete : complete || $.noop }); }); };