gpt4 book ai didi

CSS :hover rotate element and keep the new position

转载 作者:太空宇宙 更新时间:2023-11-04 03:51:38 25 4
gpt4 key购买 nike

我是否有可能(css?)在 element:hover 上旋转元素并在移出鼠标时保持新位置?

当光标离开 :hover - 区域时,元素似乎旋转回其默认位置。

编辑:

现在它似乎起作用了(忘了说,我希望它每次/多次发生):

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;
}
});

最佳答案

你可以使用 jquery:

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

记得加

$(document).ready(function(){

});

关于CSS :hover rotate element and keep the new position,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23313727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com