gpt4 book ai didi

javascript - Twitter Bootstrap 如何将下拉选择替换为菜单按钮

转载 作者:行者123 更新时间:2023-11-28 12:05:43 25 4
gpt4 key购买 nike

当我将浏览器屏幕调整为移动尺寸时,桌面菜单被包含多个选项的下拉菜单所取代:

enter image description here

但是如何使用这样的按钮将下拉菜单更改为菜单:

enter image description here

通过点击“菜单”按钮菜单显示和隐藏

最佳答案

为了得到像上面这样的菜单,我们必须遵循这个标记

<div class="row-fluid">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="#"><i class="icon-home icon-white"></i> Home</a></li>
<li><a href="#">Features</a></li>
<li><a href="">Pricing</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Products<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Latest Products</a></li>
<li><a href="#">Popular Products</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Membership<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Personal Membership</a></li>
<li><a href="#">Premium Membership</a></li>
</ul>
</li>
<li><a href="#">Offers</a></li>
<li><a href="#">Gallery</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
</ul>
</li>
</ul>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</div><!-- /.navbar-inner -->
</div><!-- /.navbar -->

DEMO

关于javascript - Twitter Bootstrap 如何将下拉选择替换为菜单按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19723418/

25 4 0