Hi there,
I’m trying to implement a vertical folding navigation tool. I have my items set out as categories in EE, and my code on the page looks like this:
{exp:weblog:categories style="nested" parent_only="no" class="head"}
{category_name}
{/exp:weblog:categories}
Now, I want each “parent” category to be the main link; click on it, and the children slide down, pushing the other parents down to make room.
My jQuery looks like this:
jQuery().ready(function(){
jQuery('#nav_categories').accordion({
header: '#ul li a',
event: 'click',
active: false,
alwaysOpen: false,
clearStyle: true,
autoHeight: false
});
});
What I end up with is all my categories splayed out, all on top of each other (I can’t seem to set the initial state to hidden). However, if you click on those headings, in rather unpredictable ways, the subcategories fold up. So while it’s a dog’s breakfast right now, the jQuery is firing, and an accordion effect is occurring.
The problem seems to be that I can’t format my list output to match what this jQuery script needs. Ideally I’d like my parent categories to be formatted as <h2>‘s, and the subcategories to be in their own div. But I don’t think that’s possible.
Any advice on what to look at next would be greatly appreciated!
Cheers,
Aaron