JSFiddle - React, Tailwind, and code Playground
HTML
<img src="http://i.imgur.com/ABktns.jpg" /> <br /><br />
JavaScript
$.fn.clockwiseRotate = function () {
$(this).each(function () {
var self = $(this),
degree = 0;
scale = 0;
var interval = setInterval(function () {
self.css({
'-webkit-transform': 'rotate(' + degree + 'deg) scale(' + scale + ')'
});
self.css({
'-moz-transform': 'rotate(' + degree + 'deg) scale(' + scale + ')'
});
self.css({
'transform': 'rotate(' + degree + 'deg) scale(' + scale + ')'
});
degree++;
scale+=(1/360);
if (degree === 361) {
clearInterval(interval);
}
}, 1);
});
};
$('img').clockwiseRotate();