Reputation: 279
I want the exact function as shown here in the menu with the icon
So far I have:
Code so far: JSFiddle
$("li.dropdown > a > i").hover(
function () {
$(this).addClass("gxcpl-fa-rotate-45");
},
function () {
$(this).removeClass("gxcpl-fa-rotate-45");
}
);
Upvotes: 0
Views: 250
Reputation: 1685
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.dropdown").hover(
function () {
$(this).find("i").addClass("gxcpl-fa-rotate-45");
},
function () {
$(this).find("i").removeClass("gxcpl-fa-rotate-45");
}
);
Check out the fiddle here
Upvotes: 2