私はブートストラップパネルの中に別のパネルを入れ子にしています(ブックレイアウトのようなもの、各セクション内のチャプタ、両方のレベルの折り畳み可能なもの)。インナーパネル(チャプタ名)にhrefを提供しようとしていますが、現在セクションが折りたたまれている場合、ブラウザはそのポイントまでスクロールしません。ブートストラップが折りたたまれたパネル内のリンクにジャンプする
<div class="accordian" id="accordion1">
<!-- Multiple such sections -->
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title top-heading" data-toggle="collapse" data-parent="#accordion1" href="#collapse1">
Section 1
</h2>
</div>
<div id="collapse1" class="panel-collapse collapse in subsection">
<!-- Each section has multiple chapters -->
<div class="panel-body">
<div class="panel-group" id="subaccordion1">
<!-- Panel for chapter 1 -->
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title chapter-name" data-toggle="collapse" data-parent="#subaccordion1" href="#collapse1InnerOne1">
<!-- The above link works when the panels are all expanded but not when they are collapsed. How to get it to work all the time? -->
Chapter 1
</h4>
</div>
<div id="collapse1InnerOne1" class="panel-collapse collapse in">
<div class="panel-body">
<ul>
Chapter 1 content
</ul>
</div>
</div>
</div>
<!-- Panel for chapter 2 -->
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title chapter-name" data-toggle="collapse" data-parent="#subaccordion1" href="#collapse1InnerOne2">
Chapter 2
</h4>
</div>
<div id="collapse1InnerOne2" class="panel-collapse collapse in">
<div class="panel-body">
<ul>
Chapter 2 content
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Panel for section 2 with chap 2&3 etc -->
#collapse1InnerOne1
リンクそれらが折りたたまれたときにパネルが開いているではないときに動作します。どちらの場合でもそれを稼働させるにはどうすればいいですか?おかげさまで
スクロールに役立ちますように。 'opacity:0;を使うことができます。高さ:0 'を回避する。 – Ohgodwhy
それについて詳しく教えてもらえますか?私はそれらの属性をどこに置くべきですか? – sudshekhar
これをネイティブにブートストラップのクラスで行うことはできません。独自のクラスを処理する必要があります。不透明度:1を持つもの。 height:auto'と 'opacity:0;高さ:0;とそれぞれトグルします。 – Ohgodwhy