Hopefully this is an easy one... I'm building a multi-level navigation system. You click on one box and a set of sub-boxes displays underneath. Since there are multiple possible sets of sub-boxes, I've tried to write a function to hide them and only display the relevant one. Here's some code:
// hide all childLevel box sets in case of previous clicks myNodes = $(childLevel).select('div'); // grab all box sets inside childLevel for(x=0;x<myNodes.length;x++) { // loop through each div if(!$(myNodes[x]).hasClassName(newBox)) { // hides everything except newBox Element.hide(myNodes[x]); } } // show the relevant box new Effect.toggle(newBox, 'appear'); new Effect.Grow(newBox, 120); In my page, I call the above code in order to show a div with the newBox class and hide all the others, in case the user has already selected one box (and thus displayed its children). When I click a box for the first time, its children are displayed, but when I click a different box, the first box's children disappear but nothing else shows up. All the possible children are set to display:none and I know Prototype has issues with this - can anyone advise me on how to get this to work? Thanks Matt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---