JSFiddle - React, Tailwind, and code Playground
by xavierm02
HTML
<img id="img" src="http://uploads.siteduzero.com/files/257001_258000/257108.png" />
<script>
var a = 0;
var i = document.getElementById( 'img' );
var s = i.style;
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function */ callback, /* DOMElement */ element){
window.setTimeout(callback, 1000 / 60);
};
})();
function f( ) {
a = ( a - 1 ) % 360;
s.WebkitTransform = s.MozTransform = s.msTramsform = s.OTransform = s.transform = 'rotate(' + a + 'deg)';
requestAnimFrame( f, i );
}
f( );
</script>