I'm using jqueryui's accordion control. I'm required to set up a navigation that involves accordions within accordions. It looks like it builds all the accordions okay. I expand the first one and see the second one. When I expand the second one, I see it expand, but then its parent accordion rolls up and hides the child accordion I just expanded.
This codepen shows my problem: http://codepen.io/chodenode/pen/Evnsz
Many thanks for any help:
My HTML:
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css">
<body>
<ul id="navigation">
<li class="parent-li">
<span class="topic"><a href="">Cardiac</a></span>
<span class="header"></span>
<ul>
<li class="parent-li">
<span class="topic">Coronary Atherosclerosis</span>
<span class="header"></span>
<ul>
<li>
<a href="">Clinical Outcome Profile</a>
<span class="header"></span>
<ul>
<li>Coronary Atherosclerosis Per 1000 ACA</li>
<li>Coronary Atherosclerosis Comorbidity</li>
<li>Coronary Atherosclerosis % with PTCA</li>
<li>Coronary Atherosclerosis Mortality Rate</li>
</ul>
</li>
<li>
<a class="parent" href="">MS-DRG Care Management Profile</a>
<span class="header"></span>
<ul>
<li>MS-DRG 286 Circulatory disorders except AMI w card cath w MCC</li>
<li>MS-DRG 302 Atherosclerosis w MCC</li>
<li>MS-DRG 303 Atherosclerosis w/o MCC</li>
<li>MS-DRG 304 Hypertension w MCC</li>
</ul>
</li>
</ul>
</li>
<li class="parent-li">
<span class="topic">Chest Pain</span>
</li>
<li class="parent-li">
<span class="topic">Angina</span>
</li>
</ul>
</li>
<li class="parent-li">
<span class="topic">Vascular</span>
<span class="header"></span>
<ul></ul>
</li>
<li class="parent-li">
<span class="topic">Respiratory</span>
<span class="header"></span>
<ul></ul>
</li>
</ul>
</body>
My code:
$(document).ready(function() {
$('#navigation').accordion({
header: '.header',
event: 'click',
collapsible: true,
heightStyle: 'content',
active: false,
fillSpace: true,
});
$('a').click(function(event) {
event.preventDefault();
});
});