我在btn-group中有3个按钮,我需要看到按下的按钮列表,按下其他按钮后,折叠列表应该消失,并且只显示按下按钮列表。
请建议。
<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="btn-group btn-group-justified">
<a href="#demo" class="btn btn-primary" data-toggle="collapse">List 1</a>
<a href="#demo1" class="btn btn-primary" data-toggle="collapse">List 2</a>
<a href="#demo2" class="btn btn-primary" data-toggle="collapse">List 3</a>
</div>
<div id="demo" class="collapse in">
<table class="table table-striped table-bordered table-hover">
<thead>
</thead>
<tbody data-link="row" class="rowlink">
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="#inputmask">Input mask</a>
</td>
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="http://www.jasny.net/" target="_blank">jasny.net</a>
</td>
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="#rowlinkModal" data-toggle="modal">Launch modal</a>
</td>
</tbody>
</table>
</div>
<div id="demo1" class="collapse">
<table class="table table-striped table-bordered table-hover">
<thead>
</thead>
<tbody data-link="row" class="rowlink">
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="#inputmask">Input mask</a>
</td>
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="http://www.jasny.net/" target="_blank">jasny.net</a>
</td>
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="#rowlinkModal" data-toggle="modal">Launch modal</a>
</td>
</tbody>
</table>
</div>
<div id="demo2" class="collapse">
<table class="table table-striped table-bordered table-hover">
<thead>
</thead>
<tbody data-link="row" class="rowlink">
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="#inputmask">Input mask</a>
</td>
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="http://www.jasny.net/" target="_blank">jasny.net</a>
</td>
<tr class='clickable-row' data-href='url://link-for-first-row/'>
<td><a href="#rowlinkModal" data-toggle="modal">Launch modal</a>
</td>
</tbody>
</table>
</div>
</div>
答案 0 :(得分:0)
你非常接近,只需要添加一些东西......
更新了代码
COPY
&#13;