我試圖做一個登錄/註冊模式打開引導模式中的特定可摺疊的面板,但我不能創造適當的面板在這個模式的鏈接。如何通過單擊鏈接
按鈕:
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle activation-menu-cta" aria-expanded="false">Btn <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right-fix">
<li><a id="panelOne" type="btn" data-toggle="modal" href="#myModal">panel one</a></li>
<li><a id="panelTwo" type="btn" data-toggle="modal" href="#myModal">panel two</a></li>
</ul>
模式:
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
panel one
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">text 1</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
panel two
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">text 2</div>
</div>
</div>
</div>
</div>
</div>
</div>
https://jsfiddle.net/gmoefesr/1/
它的工作原理!謝謝你爲我做的一切 :) – marcJEE