[英]Rotate and Hold Postion of Font Awesome Icon
I want the exact function as shown here in the menu with the icon 我想确切的函数,如在这里与图标菜单
So far I have: 到目前为止,我有:
Code so far: JSFiddle 到目前为止的代码: JSFiddle
$("li.dropdown > a > i").hover(
function () {
$(this).addClass("gxcpl-fa-rotate-45");
},
function () {
$(this).removeClass("gxcpl-fa-rotate-45");
}
);
You're only targeting the icon: 您只定位图标:
$("li.dropdown > a > i").hover(
You need to target the <li>
and then apply the class to its child <i>
: 您需要定位
<li>
,然后将该类应用于其子<i>
:
$("li.dropdown").hover(
function () {
$(this).find("i").addClass("gxcpl-fa-rotate-45");
},
function () {
$(this).find("i").removeClass("gxcpl-fa-rotate-45");
}
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.