문제

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;
    }
});
도움이 되었습니까?

해결책

You can use jquery:

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

remember adding

$(document).ready(function(){

});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top