我正在实现一个嵌套式手风琴,但当我点击父级手风琴中的子组件时,它会关闭父级手风琴。我希望在点击子组件时,父级手风琴保持打开状态。
HTML:
<div id="accordion">
<h3>Home</h3>
<div id="accordion">
<h3>Sub-Div1</h3>
<div>
<p>This is a sub-div</p>
</div>
</div>
</div>
脚本:
<script>
$("#accordion").accordion({
header: "> h3:not(.item)",
heightStyle: "content",
active: false,
collapsible: true
});
</script>