Jeca
Joined: 17 Jan 2007 Posts: 1
|
Posted: Wed Jan 17, 2007 8:24 pm Post subject: vertical menu |
|
|
Hi everybody,
I’m trying to make a vertical menu that would expand. This is javascript function that I have so far:
menu_status = new Array();
function showHide(theid)
{
if (document.getElementById)
{
var switch_id = document.getElementById(theid);
if(menu_status[theid] != 'show')
{
switch_id.className = 'show';
menu_status[theid] = 'show';
}
else
{
switch_id.className = 'hide';
menu_status[theid] = 'hide';
}
It works fine except one thing: once I select different parent-menu a child-menu from previous parent-menu is not closed. So I could expend every parent-menu and see all child-menus in same time. What I want is to see child-menu from only selected parent-menu, and I don’t know how to do it!
Any ideas?
(i think i should have to loop through them and close each one individually each time I expand a parent, BUT I don't know how )
Thanks so much for your time guys
Jeca  |
|