我正在使用 jqueryui 的手风琴控件。我需要设置一个涉及手风琴内的手风琴的导航。看起来它可以构建所有的手风琴。我展开第一个并看到第二个。当我展开第二个时,我看到它展开了,但随后它的父手风琴卷起并隐藏了我刚刚展开的子手风琴。
这个codepen显示了我的问题:http ://codepen.io/chodenode/pen/Evnsz
非常感谢您的帮助:
我的 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>
我的代码:
$(document).ready(function() {
$('#navigation').accordion({
header: '.header',
event: 'click',
collapsible: true,
heightStyle: 'content',
active: false,
fillSpace: true,
});
$('a').click(function(event) {
event.preventDefault();
});
});