-1

i have a div i want to rotate it on mouseenter event,

I want the rotation to be animated not one move - like :hover - , with jQuery of course any ideas to make it??

Majed DH
  • 1,251
  • 18
  • 35

1 Answers1

1

you will find many examples if you hollow your search. For example, from here I found this:

$(function() {
    var $elie = $(selectorForElementsToRotate);
    rotate(0);
    function rotate(degree) {

          // For webkit browsers: e.g. Chrome
        $elie.css({ WebkitTransform: 'rotate(' + degree + 'deg)'});
          // For Mozilla browser: e.g. Firefox
        $elie.css({ '-moz-transform': 'rotate(' + degree + 'deg)'});

          // Animate rotation with a recursive call
        setTimeout(function() { rotate(++degree); },5);
    }
});
Community
  • 1
  • 1
Francois Borgies
  • 2,378
  • 31
  • 38