gpt4 book ai didi

css - 鼠标移出时图标旋转

转载 作者:太空宇宙 更新时间:2023-11-04 09:11:44 28 4
gpt4 key购买 nike

我指的是 this question分别this JSFiddle .我想让图标在鼠标移出时反向旋转。有什么建议吗?

.fa-spin-hover:hover {
-webkit-animation: spin 1s 1 linear;
-moz-animation: spin 1s 1 linear;
-o-animation: spin 1s 1 linear;
animation: spin 1s 1 linear;
}

<i class="fa fa-circle-o-notch fa-spin-hover" style="font-size:100px"></i><br />

最佳答案

请试试这个。这使用了一点点 javascript 和 CSS。您将能够对此有所了解。

$(".circle").mouseover(function(){
$(".circle").removeClass("reverse").addClass("hover");
}).mouseout(function(){
$(".circle").removeClass("hover").addClass("reverse");
});
.hover {
-ms-transform: rotateX(360deg);
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
-ms-transition:1s all;
-webkit-transition:1s all;
transition:1s all;
}

.reverse {
-ms-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
-ms-transition:1s all;
-webkit-transition:1s all;
transition:1s all;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

</head>
<body>
<i class="fa fa-circle-o-notch circle" style="font-size:100px"></i>

</body>
</html>

关于css - 鼠标移出时图标旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42079049/

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