How do I open two menus with one click?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
modernpixel
Beginner
Beginner
Posts: 1
Joined: Tue Jun 01, 2004 6:27 pm

How do I open two menus with one click?

Post by modernpixel »

I want one click to open two menus - is it possible? if so, what is the javascript that I should be using in addition to the script to popup one menu:

Code: Select all

<a href=# 
onmouseover="popup('services','servicesmenu')" onmouseout=popdown()><img src="Common/images/nav_services.gif" alt="nav_services.gif" width="67" height="22" border="0" name=servicesmenu id=servicesmenu></a>
Thanks.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Just continue on the same path, adding another popup() to the onmouseover event handler... like so:

Code: Select all

<a href=# 
onmouseover="popup('services','servicesmenu');popup('menuName','id')" onmouseout=popdown()><img src="Common/images/nav_services.gif" alt="nav_services.gif" width="67" height="22" border="0" name=servicesmenu id=servicesmenu></a>
Note the semicolon between each successive function call.

Another possibility would be to write a separate function to open multiple menus, then call that function from the onmouseover event. You could even go nuts and write a function that would open any menu whose name you passed to it, and would handle any number of menus (holler if you want to take a look at that).

Hope that helps,

Kevin
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Hi Kevin,

Can you tell me if this works in a div?

Thanks,

maz
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 Maz,

Should work. Although I have run into problems in the past where an <a> link in a div stops working if you overlap the div with another one (even if the div containing the link has a higher z index).

Kevin
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Kevin,

I can't remember exaclty, its a css browser bug that occurs in any div in ie with position absolute, or is that Mac, something like that.

maz
Post Reply