0
我正在使用引導程序3,並使用此代碼進行導航。Bootstrap 3,下拉問題
<div class="navbar navbar-default navbar-fixed-top">
<style>
body {
padding-top: 120px;
}
</style>
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="animbrand"><a class="navbar-brand" href="index">Home</a></div>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="portfolio"><span class="glyphicon glyphicon-th-large"></span> Portfolio</a>
</li>
<li><a href="#"><span class="glyphicon glyphicon-music"></span> Music</a>
</li>
<li><a href="#"><span class="glyphicon glyphicon-file"></span> Blog</a>
</li>
<li><a href="#"><span class="glyphicon glyphicon-envelope"></span> Contact</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-user"></i> <i class="glyphicon glyphicon-chevron-down"></i></a>
<ul class="dropdown-menu">
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
<li><a href="#"><span class="glyphicon glyphicon-list-alt"></span> Profile</a></li>
</ul>
</li>
<li><a href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</li>
</ul>
</div>
</div>
</div>
問題不在於代碼,而是發生了什麼。如果我按下Glyphicon上去(向上箭頭的URL變成索引#)它會帶我到頁面,沒有問題,但然後我不能點擊下拉菜單,直到我回到我的/索引頁面。
http://i62.tinypic.com/1iyh38.png
http://i58.tinypic.com/2pqw9cm.png