I have a dropdown menu and in the corner of <li>
I have an icon of Font Awesome
that symbolizes an upside-down arrow ( fa fa-level-up pull-right
) and when the user clicks on that <li>
and opens the dropdown, the I would like to use JQuery to create a new JQuery code, but I do not know how to get the JQuery path to find the icon, it follows the JQuery code I have and the HTML.
JQuery:
$(function(){
$(".longBarVertical .menuVertical .liClassLBV .span .i").on("change.level", function() {
$(this).prev().find(".fa").eq(1).removeClass("fa fa-level-down pull-right").addClass("fa fa-level-up pull-right");
});
$('.longBarVertical .menuVertical .liClassLBV .span .i').on("change.level", function() {
$(this).prev().find(".fa").eq(1).removeClass("fa fa-level-up pull-right").addClass("fa fa-level-down pull-right");
});
})
HTML:
<div class="longBarVertical">
<div class="logo">
<a href="home.php">
<img src="img/logoGAP.png">
</a>
</div>
<ul class="menuVertical">
<li>
<a class="liClassLBV" href="#" data-toggle="collapse" data-target="#submenu-1">
<i class="fa fa-file-text-o"></i><span>Atendimento<i class="fa fa-level-up pull-right"></i></span>
</a>
</li>
<div class="submenu">
<ul id="submenu-1" class="collapse">
<li><a href="#"><i class="fa fa-angle-double-right"></i><span> Novo </span></a></li>
<li><a href="#"><i class="fa fa-angle-double-right"></i><span> Em aberto </span></a></li>
</ul>
</div>
</ul>
</div>