Reputation: 5113
I am trying to rotate an element clockwise 90 degrees on mouseover, and return it to its original position on mouseout.
Making this happen is simple enough, but when I try to use the .animate()
function to make it seem like a transition, nothing happens.
Here is a jsfiddle that may help you understand what I want.
Upvotes: 0
Views: 56
Reputation: 2803
You don't have to use .animate()
just use .css()
and CSS3.
$('i.brand').hover(function () {
rotation += 90;
$(this).animateRotate(rotation);
}, function () {
rotation -= 90;
$(this).animateRotate(rotation);
});
CSS
.brand{
-webkit-transition: all ease 1s;
transition: all ease 1s;
}
Upvotes: 1