$(document).ready(function(){
$('#icon').on('click', function(){
var $this = $(this);
if ($this.hasClass('animated')) {
return;
}
$this.addClass('animated');
$this.css("transform","rotate(360deg)");
setTimeout(function () {
$this.removeClass('animated');
$this.css("transform","rotate(0deg)");
}, 800);
});
});
#icon{
overflow:hidden;
}
.animated {
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
-o-transition-duration: 0.8s;
transition-duration: 0.8s;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
transition-property: transform;
}
#ff00ee
можно сократить до #f0e
padding: 10px 10px 10px 10px;
можно сократить до padding: 10px;