User:Sowminya Arikapudi/common.js: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
$('#content').animateRotate(360, 5000, function () { | |||
}); | |||
} | |||
$.fn.animateRotate = function (angle, duration, complete) { | $.fn.animateRotate = function (angle, duration, complete) { | ||
return this.each(function () { | return this.each(function () { |
Revision as of 20:41, 22 September 2015
$('#content').animateRotate(360, 5000, function () { }); } $.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 }); }); };