可能吗?我打算制作一个,但不知道该怎么做。我正在使用bootstrap tho。这就是我现在所拥有的一切
<li data-toggle="dropdown"><a href="#">Vehicles</a>
<ul class="dropdown-menu nav-tabs" role="menu">
<hr/>
<li class=" active"><a data-toggle="tab" href="#cars">Cars</a></li>
<li><a data-toggle="tab" href="#vans">Vans & Pick-Up</a></li>
<li><a data-toggle="tab" href="#mpv">MPVs</a></li>
<li><a data-toggle="tab" href="#suv">Crossover & SUVs</a></li>
<li><a data-toggle="tab" href="#hybrid">Hybrid</a></li>
<li><a data-toggle="tab" href="#performance">Performance</a></li>
</ul>
答案 0 :(得分:0)
听起来这就像你正在寻找的东西:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" id="menu" type="button" data-toggle="dropdown">Dropdown Example
<span class="caret"></span></button>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu">
<li role="presentation"><a role="menuitem" tabindex="-1" data-toggle="tab" href="#menu1">HTML</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" data-toggle="tab" href="#menu2">CSS</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" data-toggle="tab" href="#menu3">JavaScript</a></li>
</ul>
</div>
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<h3>HOME</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div id="menu1" class="tab-pane fade">
<h3>Menu 1</h3>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div id="menu2" class="tab-pane fade">
<h3>Menu 2</h3>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.</p>
</div>
<div id="menu3" class="tab-pane fade">
<h3>Menu 3</h3>
<p>Eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
</div>
</div>
</div>
&#13;
请注意,href
的{{1}}属性需要与外部内容的ID相对应。
希望这有帮助! :)