Displaying a menu by default

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
mofo
Beginner
Beginner
Posts: 2
Joined: Mon Sep 08, 2008 10:22 pm

Displaying a menu by default

Post by mofo »

I am using the menu with an imagemap and it works fine.
<area onMouseOver="popup('Research',1); shape="poly" coords="95,25,95,2,225,2,224,24,97,22,230,24" href="#" />
<area onMouseOver="popup('Academics',1); shape="poly" coords="95,25,95,2,225,2,224,24,97,22,230,24" href="#" />
(...)
I would like the menu to open on the correct tab when the user loads a page, so I tried to add the "popup" method to the OnLoad event of the body tag but it did not work. I also tried putting it inside the HTML code below the imagemap and at the end in a <script type="text/javascript"> tag but it did not work either. Note that I tried replacing the popup method by a debug function like "alert('debug') and it worked correctly.

Is there anything I should know about the loading of the menu that would explain why it works fine in the onMouseOver event and not in the other places I tried.

I also tried to use the alwaysvisible property but it was overlaping with the other menus when I rolled over them...

Thanks for your help.
mofo
Beginner
Beginner
Posts: 2
Joined: Mon Sep 08, 2008 10:22 pm

Re: Displaying a menu by default

Post by mofo »

I ended up launching the popup method in a timer "setTimeout(popup('Student',1),60);" that I embedded at the end of the HTML code. This only worked if I set enough time for the page to display completely (40-60ms depending on the page and computer).
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Displaying a menu by default

Post by Ruth »

Hi,

Could you give me a page so I can see what you want and have a page to test?

There is a module called openmenusbyurl.js which opens a menu based on the url matching, however I do not know if that works with the imagemap and I'd need a page to test it.

Ruth
Post Reply