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?

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.