Hi guys,
I'm looking to use the expanding menu code (from Ross Cairns) for some other page elements. In particular, I have some text I'd like to appear in the main content area, consisting of a title and a description. I'd like it so that when you click on the title, the description slides open below it. Similar to the code used in a menu.
I am hoping someone can guide me on how the javascript should be edited. I have tried lots of variations, but can't make it work.
The current piece of code which references the menu id is:
var item_title = $("#menu ul").eq(num).children(":first");
var items = $("#menu ul").eq(num).children().filter(function (index) { return index > 0; });
I'd like to add a second menu that I want to appear in the content area. I thought I'd be able to add the id (#content ul) to the above code as follows:
var item_title = $("#menu ul, #content ul").eq(num).children(":first");
var items = $("#menu ul, #content ul").eq(num).children().filter(function (index) { return index > 0; });
Obviously this isn't correct. I'm not a programmer, so I'm just guessing things trial and error style.
If anyone can shed light on the right way to do it I'd appreciate it.
Thanks,
G