I have a series of bootstrap 3 accordion panels with lots of content in them that are almost working... they load collapsed as wanted and open when clicked as they should, collapsing any other open panels in the process; all good...
but when I open Panel 1 and scroll down its content, and then open Panel 2, the Panel 2 content loads "upwards" past the top of the visible browser window; meaning the user has to scroll up to see the top of Panel 2. Frustrating!
I want Panel 2 to load so the top of it is visible within the browser window.
Here's a JSFiddle
<!-- language: lang-html --><div class="panel-group" id="accordion">
<!-- first panel -->
<div class="panel panel-default">
<div class="panel-heading">
<span class="strong">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapseOne" id="predict">
Gettysburg <span class="caret"></span>
</a>
</span>
</div>
<div id="collapseOne" class="panel-collapse collapse">
<div class="panel-body">
<!--LOTS OF CONTENT - replaced with image-->
<img src="http://i.imgur.com/AMhADP1.png" />
</div>
</div>
</div>
<!-- second panel -->
<div class="panel panel-default">
<div class="panel-heading">
<span class="strong">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" id="aries">
Background <span class="caret"></span>
</a>
</span>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="panel-body">
<!--LOTS OF CONTENT - replaced with image-->
<img src="http://imgur.com/j98Q0H8.png" />
</div>
</div>
</div>
</div>
Any ideas on how I can fix this, please?