-1
Personal,
I’m still studying java script, I’m making a MENU and it’s working, I made it from scratch and I’m correcting every step I want and I didn’t have... I got stuck now...
The menu opens, goes down the submenu and goes up, right, but I put an icon to say when it goes down and when it goes up, and it changes in all situations, only one that does not... when the submenu returns... look at the logic I did, but there is something wrong with this if...
$(".button-menu").click(function() {
document.getElementById("index-menu-left").style.width = "250px";
$("div.menu-item-text").addClass("display-inline");
$("div.menu-item-arrow").find('i').removeClass("fa-caret-down").addClass("fa-caret-right");
if ($('#index-menu-left').hasClass('show')) {
$(this).find('i').removeClass("fa-caret-right").addClass("fa-caret-down");
}
})
That ". show" is the class that add when it opens the submenu, and wanted to catch it to change the arrow... if there is this class, the arrow goes down when it does not, it stands right.
With this one works, but when I click on another link, the icon does not change
$(this).find('i').toggleClass("fa-caret-right fa-caret-down");
Cara se vc postar o HTML/CSS will help you get an answer, without them can not simulate your problem
– hugocsl