I have some code that is generated using php. It outputs a nested accordion. For some reason the accordion looks very screwed up. So much so that I can’t even explain. Here is the code that is generated:
<div class='accordion'>
<h3>2012</h3>
<div class='accordion'>
<h3>October 2012</h3>
<div>October 5, 2012</div>
<div>October 5, 2012</div>
<div>October 4, 2012</div>
<div>October 4, 2012</div>
<div>October 4, 2012</div>
<div>October 3, 2012</div>
<div>October 3, 2012</div>
<div>October 3, 2012</div>
<div>October 1, 2012</div>
<div>October 1, 2012</div>
<div>October 1, 2012</div>
<div>October 1, 2012</div>
</div>
<div class='accordion'>
<h3>September 2012</h3>
<div>September 30, 2012</div>
<div>September 29, 2012</div>
<div>September 29, 2012</div>
<div>September 26, 2012</div>
<div>September 26, 2012</div>
<div>September 25, 2012</div>
<div>September 24, 2012</div>
<div>September 19, 2012</div>
<div>September 19, 2012</div>
<div>September 19, 2012</div>
<div>September 19, 2012</div>
<div>September 19, 2012</div>
<div>September 11, 2012</div>
<div>September 5, 2012</div>
</div>
<div class='accordion'>
<h3>August 2012</h3>
<div>August 19, 2012</div>
<div>August 17, 2012</div>
<div>August 9, 2012</div>
<div>August 4, 2012</div>
<div>August 4, 2012</div>
<div>August 4, 2012</div>
<div>August 4, 2012</div>
<div>August 4, 2012</div>
<div>August 4, 2012</div>
<div>August 2, 2012</div>
</div>
<div class='accordion'>
<h3>July 2012</h3>
<div>July 1, 2012</div>
<div>July 1, 2012</div>
</div>
</div>
I call it using:
$(document).ready(function(){
$('div.accordion').accordion({
autoHeight:false,
collapsible:true,
active:false});
});
This looks like it should work. To see what it’s doing go to:
http://lonewolfdigital.com/misc/test/
An accordion has a heading.. then it’s contents.. so what you want is this structure
http://jsfiddle.net/c8qW3/