我的网站上有自举手风琴,现在我正在尝试扩展相应的面板 超链接点击(来自同一网站的另一个网页)。我已经尝试过在其他.net社区提供的大部分解决方案,但没有运气。由于我是JavaScript或jquery的新手,我可能会编写错误的代码。任何解决这个问题的建议都会有所帮助。
<div class="panel-group" id="accordion">
<div class="panel panel-success">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#accordionTwo">
<b>Vehicle Code Matching</b>
</a>
</h4>
</div>
<div id="accordionTwo" class="panel-collapse collapse">
<div class="panel-body">
Test paragraph 1
</div>
</div>
</div>
<div class="panel panel-success">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#accordionThree">
<b>Vehicle Data Association</b>
</a>
</h4>
</div>
<div id="accordionThree" class="panel-collapse collapse">
<div class="panel-body">
Test paragraph 2
</div>
</div>
</div>
<div class="panel panel-success">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#accordionFive">
<b>Data Cleansing</b>
</a>
</h4>
</div>
<div id="accordionFive" class="panel-collapse collapse">
<div class="panel-body">
Test paragraph 3
</div>
</div>
</div>
</div>
答案 0 :(得分:0)
添加到Guruprasad Rao的评论,当您知道需要打开哪个面板(在页面之间传递数据)时,您可以在需要默认打开的面板中添加“in”类。如果你愿意,你也可以使用$('面板的ID')使用javascript激活手风琴.colla('show')函数。见http://getbootstrap.com/javascript/#collapse-example-accordion