Css: hover the rotation element and save the new position

Do I have (css?) The ability to rotate an element on element:hoverand save a new position when moving the mouse?

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

change

now it seems to work (forgot to say that I wanted this to happen every time / several 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;
    }
});
0
source share
1 answer

You can use jquery:

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

remember add

$(document).ready(function(){

});
+2
source

Source: https://habr.com/ru/post/1679092/


All Articles