好的我的网站吓坏了!!我只需要让我的菜单响应......并且我的网站上的悬停效果不会让链接响应,所以我想让它成为一个折叠菜单,但由于某种原因它不起作用。我显示正常,但是一旦我在移动设备上查看它,它会显示带有条形的按钮,但是它没有切换我的菜单你能帮我弄清楚什么是错的吗?
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="col-sm-2 col-md-2"></div>
<div class="col-sm-8 col-md-8" style=" border-radius:5px; border-bottom-color:Silver; border:3px; border-top-color: transparent !important; background-color:rgba(0,0,0,.8)">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#homenav">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="homenav">
<ul class="nav navbar-nav">
<li><a href="pages/home.html" class="menu_nav demo-4">
<span>
<span>Home</span>
<span>-Home-</span>
<span></span>
</span>
</a></li>
<li> <a href="pages/artist.html" class="menu_nav demo-4">
<span>
<span>Roster</span>
<span>-Roster-</span>
<span></span>
</span>
</a></li>
<li>
<a href="pages/order.html" class="menu_nav demo-4">
<span>
<span>Brands</span>
<span>-Brands-</span>
<span></span>
</span>
</a>
</li> <li>
<a href="pages/music.html" class="menu_nav demo-4">
<span>
<span>Music</span>
<span>-Music-</span>
<span></span>
</span>
</a>
</li>
<li>
<a href="pages/videos.php" class="menu_nav demo-4">
<span>
<span>Videos</span>
<span>-Videos-</span>
<span></span>
</span>
</a> </li>
<li>
<a href="pages/videos.php" class="menu_nav demo-4">
<span>
<span>Store</span>
<span>-Store-</span>
<span></span>
</span>
</a>
</li>
<li>
<a href="pages/services.html" class="menu_nav demo-4">
<span>
<span>Services</span>
<span>-Services-</span>
<span></span>
</span>
</a>
</li>
<li>
<a href="#" class="menu_nav demo-4">
<span>
<span>Resources</span>
<span>-Resources-</span>
<span></span>
</span>
</a> </li>
</ul>
</div>
<div class="col-sm-2 col-md-2"></div>
</div>
</nav>
<!--End Of Navigation-->
答案 0 :(得分:1)
我认为你缺少javascript文件。将它包含在您的项目中,它应该可以工作。
<script src="https://code.jquery.com/jquery-1.12.0.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>