2
I’m making a menu with a toggle using Jquery. The menu is working perfectly.
I’m using a class from Font Awesome to show the icon on the button to activate the toggle. I want to change the class fa-chevron-circle-down
for fa-chevron-circle-up
when the toggle is activated, and return the class to initial when the toggle is disabled.
Follows the code
HTML:
<nav class="nav-menu">
<ul class="nav-list shadow">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
<button class="nav-toogle shadow"><i class="fa fa-chevron-circle-down fa-3x" alt="Menu Arrow"></i>
</button>
</nav>
jQuery:
$(document).ready(function(){
$('.nav-toogle').click(function(){
$('.nav-list').slideToggle('slow');
});
});
Thank you, Sergio. Solved my problem. The menu is working perfectly.
– Raphael Americano