为什么不在小屏幕上打开导航栏?

时间:2016-04-25 02:53:18

标签: html css angularjs twitter-bootstrap twitter-bootstrap-3

当屏幕大于nav-bar时,此640px可正常工作,但当小屏幕上显示菜单按钮时,单击该按钮不会显示菜单项。这是site

<nav class="navbar navbar-inverse">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#BHC-Navbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span> 
                <span class="icon-bar"></span> 
                <span class="icon-bar"></span> 
            </button>
            <a class="navbar-brand" href="#">Bunker Hill</a>
        </div>
        <div class="collapse navbar-collapse" id="BHC-Navbar">
            <ul class="nav navbar-nav">
                <li class="active"><a href="#"><i class="glyphicon glyphicon-home"></i> Home</a></li>
                <li><a href="#services" class="glyphicon glyphicon-info-sign"> Services</a></li>
                <li><a href="#clients" class="glyphicon glyphicon-info-sign"> Clients</a></li> 
                <li><a href="#about" class="glyphicon glyphicon-info-sign"> About</a></li> 
                <li><a href="#contact"><i class="glyphicon glyphicon-envelope"></i> Contact</a></li> 
            </ul>
        </div>
    </div>
</nav>

2 个答案:

答案 0 :(得分:2)

您错过了bootstrap.min.js,因此您需要添加以下内容:

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

修改

您需要在加载此js文件之前添加jQuery库。

答案 1 :(得分:1)

看起来你并没有在任何地方调用bootstrap.js或bootstrap.min.js。打电话给那个剧本,你应该好好去。