test to see if menu is showing

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Mrfunkleberry
Beginner
Beginner
Posts: 7
Joined: Sat May 14, 2005 12:56 pm
Contact:

test to see if menu is showing

Post by Mrfunkleberry »

How can i test to see if a menu if showing?

i think need to search through _m
and return 'menu1' or 'menu2' etc
if that menu is showing.

Can't seem to find a good description of _m
but i assume its stored in there somewhere _m[?]

any help?

This is the last thing i have to do before i have an Iframe/ie/firefox/safari compatable menu (taken me all day!)
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm not sure what you mean. I would put it no the web and and go to the site and see if it's there.

Ruth
Mrfunkleberry
Beginner
Beginner
Posts: 7
Joined: Sat May 14, 2005 12:56 pm
Contact:

done it...

Post by Mrfunkleberry »

found it...

for(_a=1;_a<_m.length;_a++)
{
if (_m[_a][7] == 1) { activemenu = _a; }
}
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Ruth is correct - just post the page and see what you get. There is no reason to be messing with the code, which will void all support.
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Mr. Funkleberry,
Mrfunkleberry wrote:How can i test to see if a menu if showing?
I think my friends may have misunderstood... understandable given the phrasing of the question. You don't mean that you want to see for yourself if the menu is visible on a page. You mean that you want to programatically test to see if a given menu, at a given time, is open or not.

Unfortunately, I think you're on the wrong track (you may have discovered this by now). _m[7] represents the menu's alwaysvisible property, which essentially determines whether a menu is treated as a "main" menu (i.e., one that is always open) or not. if _m[7] is 1 or true, then the menu is always visible.

I recall doing a similar test some time ago. I think I got the menu object for the menu in question, then tested it's visibility attribute. I'll dig around and see if I can find the code I used and post it.

Cheers,

Kevin
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Again,

Here is the thread I was thinking of. The mm_isOpen() function is what I had in mind. It worked then. Don't see why it wouldn't work now, although I can't swear to what browsers it'll work with. You may want to test it in all of your target browsers and tweak as needed.

Hope that helps,

Kevin
Post Reply