您好我有以下用于bootstrap nav-collapse
的html代码,有时当我点击菜单时,它需要时间才能打开,当我点击菜单名称时,它也需要时间来关闭它会自行卡住和关闭。这是一个bug还是别的什么?我已经过渡到它。
单击菜单时我需要它平滑,它应该平滑打开并顺利关闭。我有什么遗漏吗?
我使用Internet Explorer作为浏览器
HTML:
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<a rel="nofollow" class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse" title="Toggle menu">
<span class="menu-name">Menu</span>
<span class="menu-bars">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</span>
</a>
<!-- Everything you want hidden at 940px or less, place within here -->
<div class="nav-collapse collapse" style="height: 0px;">
<ul class="nav" id="topMenu" data-submenu="horizontal">
<li class=" active " style="">
<a rel="nofollow" href="//ss-template-blog03.simplesite.com/434337774">FRONT PAGE</a>
</li>
<li class=" " style="">
<a rel="nofollow" href="//ss-template-blog03.simplesite.com/434337775">BLOG</a>
</li>
<li class=" " style="">
<a rel="nofollow" href="//ss-template-blog03.simplesite.com/434337777">CONTACT</a>
</li>
</ul>
</div>
</div>
</div>
</div>
CSS
.collapse {
position: relative;
height: 0px;
overflow: hidden;
-webkit-transition: height .100s ease;
-moz-transition: height .35s ease;
-o-transition: height .35s ease;
transition: height .35s ease;
}
我的菜单图片:
答案 0 :(得分:1)
您可以针对nav-collapse
尝试以下代码。
有关bootstrap
nav-collapse
的更多帮助,请阅读此Documentation
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link1</a></li>
<li><a href="#">Link2</a></li>
<li><a href="#">Link3</a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
&#13;