JSFiddle - React, Tailwind, and code Playground
HTML
<div class="test testRotate">Test rotate</div>
CSS
.test {
width: 300px;
height: 50px;
border: 1px solid black;
padding: 20px;
margin: 0px auto;
margin-top: 50px;
}
.testRotate{
-moz-transition: transform 1s;
-webkit-transition: transform 1s;
transition: transform 1s;
}
.testRotate.rotate{
transform: rotate(360deg);
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
}
JavaScript
$(function(){
$("div").click( function(){
$(this).addClass("testRotate rotate");
setTimeout(function(){$("div").removeClass("testRotate rotate");}, 1500);
});
});