Question

I there a (css?) possibility to rotate an element on element:hover and keep the new position when moving the mouse out?

It seems that the element rotates back to it`s default position when the cursor leaves the :hover - area.

edit:

now it seems to work (forgot to say, that i wanted it to happen each time/ multiple times):

var rotate = 360;
  $('.artistbutton360').bind({
    mouseenter: function() {
      $(this).css("-webkit-transform","rotate("+ rotate +"deg)");
      $(this).css("-moz-transform","rotate("+ rotate +"deg)");
      $(this).css("-o-transform","rotate("+ rotate +"deg)");
      $(this).css("transform","rotate("+ rotate +"deg)");
      rotate = rotate + 360;
    }
});
Was it helpful?

Solution

You can use jquery:

$('element').hover(function(){
  $(this).css(whatever);
});

remember adding

$(document).ready(function(){

});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top