using both swap image and popup together

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
amweiss
Beginner
Beginner
Posts: 2
Joined: Sat Apr 10, 2004 1:15 am
Location: Los Angeles, CA
Contact:

using both swap image and popup together

Post by amweiss »

Hi,
I'm in the processing of evaluating this product, and I working on a website that is using a typical rollover, as this:

<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bookstore','','images/on_06.gif',1)"><img src="images/off_06.gif" name="bookstore"></a>

My question is can I use the above for the rollover of the main link and somehow also use Milonic for the submenus?

Here is the site I'm working on
http://www.acrwebsite.org/index4.asp

Thanks,
Allen
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 Allen,

Try this:

Code: Select all

<a href="#" onMouseOut="MM_swapImgRestore();popdown()" onMouseOver="MM_swapImage('bookstore','','images/on_06.gif',1);popup('menuName','bookstore')"><img src="images/off_06.gif" name="bookstore" id="bookstore"></a> 
Note that I have:

(1) Added popdown() to the onmouseout event

(2) Added popup() to the onmouseover event. The first parameter passed to popup() will be the name of the menu you want to open. The second parameter is the name/id of the image where the menu will open. The upper-left corner of the menu will be at the lower-left corner of the image when the menu opens. If you want, you can add a third and fourth parameter in the call to popup(), to offset the menu's top and left coordinates. e.g.,

Code: Select all

popup('menuName', 'imageName', 5, 10)
would move the menu 5px down and 10px to the right (use negative values for up and left).

(3) added id="bookstore". You'll want to use bothe the name and the id attgribute in your <img> tag, assigning the same value to both ("bookstore" in your example). If you don't us the id attibute, this won't work in NS. If you don't use the name attribute, it won't work in IE.

Hope that helps,

Kevin
amweiss
Beginner
Beginner
Posts: 2
Joined: Sat Apr 10, 2004 1:15 am
Location: Los Angeles, CA
Contact:

Post by amweiss »

HI Kevin,
Thanks...that seemed to do the trick. Any way to keep the main button rolled over while moving throughout the associated submenus? I know this might be asking a bit from javascript, but thought I'd ask.

Thanks again,
Allen
Post Reply