汉堡菜单没有隐藏在菜单上点击

时间:2017-12-29 09:53:36

标签: javascript css

我的汉堡菜单有问题。点击菜单后它没有隐藏。我是初学者,我不知道问题出在哪里? 我需要你的帮助。如果您需要有关我的代码的任何其他信息,请随时问我。

<nav id="navbar" class="navbar default">
    <div class="container mob-logo">
        <div class="navbar-header col-sm-2 tablet-logo">
            <button type="button" class="navbar-toggle mob-menu" data-toggle="collapse" data-target="#myNavbar">
                <span class="icon-bar nature"></span>
                <span class="icon-bar nature"></span>
                <span class="icon-bar nature"></span>
            </button>
            <div class="mobile-sidebar">
                <span class="sidebar-btn btn fa-bar-hide" data-action="toggle" data-side="right" >
                    <i class="fa fa-bars"></i>
                </span>
            </div>

        </div>
        <div class="collapse navbar-collapse " id="myNavbar" >
            <ul class="nav navbar-nav pull-right ">
            <li class="active">
                    <a href="#accueil" data-du-smooth-scroll data-du-scrollspy>Accueil</a>
                </li>
                <li class="active">
                    <a href="#home" data-du-smooth-scroll data-du-scrollspy>Groupe</a>
                </li>
                <li>
                    <a href="#Competences" data-du-smooth-scroll data-du-scrollspy>Competences</a>
                </li>

                <li>
                    <a href="#Services" data-du-smooth-scroll data-du-scrollspy>Services</a>
                </li>

                <li>
                    <a href="#References" data-du-smooth-scroll data-du-scrollspy>References</a>
                </li>
                <li>
                    <a href="#contact" data-du-smooth-scroll data-du-scrollspy>Contact</a>
                </li>

            </ul>
        </div>
    </div>
</nav>

1 个答案:

答案 0 :(得分:0)

$(document).ready(function(){ 
  $(".mob-menu").click(function(){ 
    $(this).hide(); 
  });
});