I am using the expandable menu js by Ross Cairns (http://www.rosscairns.com/downloads/) and I want to change the script so that when i click a exhibition category the others collapse... then if I click another the first collapses while the new opens. Basically I only want one category open at a time. Any ideas on the code for something like this?
original:
/*Expanding Menus for Indexhibit
*uses jquery
*
*Created by Ross Cairns Mar 2008
*/
function expandingMenu(num) {
var speed = 300;
var item_title = $("#menu ul").eq(num).children(":first");
var items = $("#menu ul").eq(num).children().filter(function (index) { return index > 0; });
/* hide items if not active */
if (items.is(".active") == false) {
items.hide();
}
/* add click functions + pointer to title */
item_title.css({cursor:"pointer"}).toggle(
function () {
items.show(speed);
}, function () {
items.hide(speed);
}
)
}