Keep expandable menu open?

koeske / 2010-01-29 15:15:11   

Hi all.
I've been quite busy lately. Found a lot of useful resources on the forum and learned a lot untill now.

This is the result so far

I would like to know if there's anyone who knows how to have the expandable menu content remain open after clicking on an exhibition. I have used the Ross Cairns plugin and script from this thread.

The default setting here is that you can have multiple sections open at a time, but when you click something, all sections close except for the active section.

Is there a way to leave all sections open unless you manually collapse them?

I guess it's something here but I wouldn't know exatly what or where:

/*Expanding Menus for Indexhibit
*uses jquery
*
*Created by Ross Cairns Mar 2008
*/

function expandingMenu(num) {
var speed = 500;

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);
}
)
}

Thanks!

koeske / 2010-02-02 11:08:26   

Anyone?

ivo_valadares / 2010-02-02 11:13:17   

Mybe searchin on participants list you'll find something.

blameme / 2010-02-03 13:19:32   
  1. Not sure if this is what you want but look at the "hide items if not active" function, If you made that
  2. ¬†¬†¬†¬†/* hide items if not active */
  3. ¬†¬†¬†¬†if (items.is(".active") == true) {
  4.         items.show();
  5.     }
  6.     
  7. ¬†¬†¬†¬†if (items.is(".active") == false) {
  8.         items.show();
  9.     }
  10. that would probably keep everything open until you close it manually.
blameme / 2010-02-03 13:20:41   

Not sure if this is what you want but look at the "hide items if not active" function, If you made that

  1. /* hide items if not active */
  2.     if (items.is(".active") == true) {
  3.         items.show();
  4.     }

if (items.is(".active") == false) {
items.show();
}

that would probably keep everything open until you close it manually.

blameme / 2010-02-03 13:22:07   

Sorry, I think i may be retarded, Can someone let me know if there is some kida trick to posting code?

koeske, I guess you get the idea.

Vaska A / 2010-02-03 14:06:54   

Yes, put your code inside code tags and don't have any blanks lines. If it's alot of code you probably need to break it down into smaller parts.

koeske / 2010-02-03 16:25:19   

Ok thanks!

Gonna check if this works.
Keep you posted.

richardn / 2010-02-04 12:20:45   

Koeske, did you try Blameme's suggestion? I tried it, and it worked to the extent that the opening/closing of menus is now controlled by the user, but unfortunately when the user first arrives at the site all the menus are open rather than closed.

This thread has been closed, thank you.