UNPKG

rotate-icon

Version:

The simple, easy-to-implement animation plugin to rotate icons, images, and elements.

7 lines (6 loc) 525 B
/*! * Rotate.js v1.0.3 (https://www.travismclarke.com) * Copyright 2015 Travis Clarke * Licensed under the MIT license */ !function(e,t,n){"use strict";t.fn.rotate=function(e,n){var a=t.extend({},t.fn.rotate.defaults,n),r=0;return e=e||t.fn.rotate.degrees,this.each(function(n,o){t(o).is(":animated")||(r=(o.deg||r)+e,a.step=function(e){t(o).css("transform","rotate("+e+"deg)")},t(o).animate({deg:r},a))})},t.fn.rotate.degrees=360,t.fn.rotate.defaults={duration:1e3,easing:"swing",complete:function(){}}}(window,jQuery);