$(document).ready(function(){
$('#icon').toggle(function(){
$(this).css("-webkit-transform","rotate(360deg)");
}, function(){
$(this).css("-webkit-transform","rotate(90deg)");
});
});
$(document).ready(function(){
var i = 1
$('#icon').click(function(){
$(this).css("-webkit-transform","rotate("+i*360+"deg)");
i++;
});
});
.target:hover,
.target:active{
animation: rotate 0.5s ease-in-out;
}
keyframes rotate{
to{
transform:rotate(360deg);
}
}
$(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;
}