Hidding a menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
gporterfield
Advanced
Advanced
Posts: 15
Joined: Thu Jun 12, 2003 1:58 pm
Contact:

Hidding a menu

Post by gporterfield »

I am working on a new site design. Part of my concept includes the need to hide the menu (visible = false) at some times. (Don't ask why.) Of course, I will "unhide" the menu later on.

I've tried a few variations of "menu0.visible = false;" but no success. Any suggestions on how to achieve this? :?:

TIA,
George
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

try this

mn=getMenuByName("menuname")
menuobject=gmobj("menu"+mn)
menuobject.style.visibility="hidden"

Change "hidden" to "visible" to show it again

Cheers
Andy

ps: This should work in verson 3 and version 4
gporterfield
Advanced
Advanced
Posts: 15
Joined: Thu Jun 12, 2003 1:58 pm
Contact:

Hidding a menu

Post by gporterfield »

Thanks Andy.

Your suggetion works great in IE, but NS4 complains:
menuobject.style has no properties.

Now I should be able to figure out the syntax difference for NS4, but it is escaping me right now.

TIA,
George
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Oh yeah, forgot about him

Try this

mn=getMenuByName("menuname")
menuobject=gmobj("menu"+mn)
if("ns4)
{
menuobject.visibility="hide"
}
else
{
menuobject.style.visibility="hidden"
}


Cheers
Andy
gporterfield
Advanced
Advanced
Posts: 15
Joined: Thu Jun 12, 2003 1:58 pm
Contact:

Hidding a menu

Post by gporterfield »

Thanks Andy. Should have been able to figure out that syntax myself, but yesterday was not a good day for thinking.

:D
gporterfield
Advanced
Advanced
Posts: 15
Joined: Thu Jun 12, 2003 1:58 pm
Contact:

After "un"hidding, how to make "alwayvisible&

Post by gporterfield »

OK, in much the same manner, is also possible to change the value of the "alwaysvisible" attribute?
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

I found a flag for each menu that is set when its declared as alwaysvisible. I was able to edit it dynamically (programmaticaly) but it began giving me errors. There seems to be more to it than just the menu[8] flag. (i think that was where i found it)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply