I have a show/hide toggle working well in multiple instances (thanks to help here – search for ‘jquery toggle to work in multiple instances’).
I want to integrate it into an expanding menu / accordion style for the main categories.
I have a script and it works on its own but I can’t get it to work integrated with the show/hide.
The working show/hide:
http://pastebin.me/c69869d7a80fdb439ca16304b821c146
the expanding menu script I want to integrate:
http://pastebin.me/03b685f586fef84193b5fd72e815255d
I’m not sure exactly what you’re after, so this is a bit of a guess and a quick rought cut, needs optimization, but should work:
See it in action here. This example makes it a plugin model, so you can call
$('ul').expandingMenu()(and chain it) like the example above with options for speed, how many to show, and the hide/show captions as well. Take a peek and tell me which parts aren’t quite right, easy to adjust from there.