I'm using Quicksand, which works great. It sorts my portfolio perfectly.
But since my menu is very long and involved, I'm trying to make the sub-categories show when the main category is clicked. To do this, I've played around with slideToggle (I'm not attached to this effect), which has issues.
- The toggle is sometimes executed multiple times
- Sometimes it doesn't toggle at all
- When you toggle a subcategory, the main categories in the <li>'s below it drop down beneath it.
Ideally, I'd like for all main categories to remain floating on the top. When clicked, the subcategories should appear below that main category <ul>.
Here's a fiddle:
http://jsfiddle.net/AngstyG/ELN3G/ The specific code I'm using for the toggle:
- <------some quicksand stuff------->
-
- var allPanels = $('.filter li ul').hide();
- <------more quicksand stuff------->
- $('.filter > li > a').click(function() {
allPanels.hide;
$(this).next().slideToggle();
});
- <------yet more quicksand stuff------->
I'm really new to jQuery (just a lonely asp/php dev, looking for fancy stuff), so if this is completely awful, I'd be super appreciative for any guidance.
Thanks in advance!