导航栏中的下拉菜单在浏览器最大化时工作正常,但如果我将浏览器调整为移动大小,则下拉菜单不会显示,菜单按钮也会切换。这是我的带有下拉列表的导航栏代码。我正在使用bootstrap 3.当我点击EBBL时,下拉菜单没有显示,整个导航栏菜单都被切换了。
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand page-scroll" href="<?php echo site_url('home/index')?>">BCTF</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse ">
<ul class="nav navbar-nav">
<!-- Hidden li included to remove active class from about link when scrolled up past about section -->
<li class="hidden">
<a href="#page-top"></a>
</li>
<li>
<a class="page-scroll" href="<?php echo site_url('home/index')?>">Home</a>
</li>
<li>
<a class="page-scroll" href="<?php echo site_url('home/show_about')?>">About</a>
</li>
<li>
<a class="page-scroll" href="<?php echo site_url('home/show_open_butterfly_park')?>">Open Butterfly Park</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" >EBBL<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="<?php echo site_url('home/show_ebbl')?>">About EBBL</a></li>
<li><a href="#">Content 1</a></li>
<li><a href="#">Content 2</a></li>
<li><a href="#">Content 3</a></li>
<li><a href="#">Content 4</a></li>
</ul>
</li>
<li>
<a class="page-scroll" href="<?php echo site_url('home/show_biography')?>">Biography</a>
</li>
<li>
<a class="page-scroll" href="<?php echo site_url('home/show_gallery')?>">Gallery</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>