0

Hy i have a part of my html page that is like this

 <div class="menu-wrapper">
                        <ul class="menu">
                        <li><a class="show-2" href="#">1</a></li>
                        <li><a class="" href="#">2</a></li>
                <li><a class="show-4" href="#" onclick="templatemo_map();">3</a></li>
                        </ul> <!-- /.menu -->
                        <a href="#" class="toggle-menu"><i class="fa fa-bars"></i></a>

and the part of js that im intereset

    /************** Toggle Menu *********************/
    $('a.toggle-menu').click(function(){
        $(".menu").slideToggle(400);
        return false;
    });

what i'm trying to figure out is when i click toggle-menu link it show me the menu, i whant to cancel that fa fa-bars and open automaticaly the menu,always slideToggle(400) it is possible?

2
Contributors
1
Reply
24
Views
3 Years
Discussion Span
Last Post by hericles
0

To remove the "fa fa-bars" class you can use this:

$.('.menu').removeClass('fa');

And to add a class use .addClass(). The toggle should work as it is. Is it not working currently?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.