我試圖讓幾行崩潰,當我點擊父行。目前,我只能摺疊單行,但我需要能夠同時關閉+2行。Bootstrap崩潰表
下面是我目前的代碼,在這段代碼中,當我單擊第一行時,我無法弄清楚如何摺疊「HIDDEN」和「HIDDEN 2」行。
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous">
<style>
.hiddenRow {
padding: 0 !important;
}
</style>
<div id="accordion" role="tablist" aria-multiselectable="true">
<table class="table">
<tr id="main" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<td>
test
</td>
</tr>
<tr>
<td class="hiddenRow">
<div id="collapseOne" class="collapse in" aria-labelledby="headingOne">HIDDEN</div>
</td>
</tr>
<tr>
<td class="hiddenRow">
<div id="collapseTwo" class="collapse in" aria-labelledby="headingTwo">HIDDEN 2</div>
</td>
</tr>
</table>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script>
哪裏是你的JS? – Rafael
你是什麼意思?這僅僅是一個HTML頁面,無論從jQuery和引導 –