Using DHTML Menu with onUnload javascript command

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
zscribe
Beginner
Beginner
Posts: 1
Joined: Thu Apr 10, 2003 6:58 pm
Location: New York, USA
Contact:

Using DHTML Menu with onUnload javascript command

Post by zscribe »

Hello folks...

I am currently using the DHTML menu on my website and am very pleased with how it works. I've just added a pop-up on exit using javascript's onUnload command.

One of the things that I have to do with this script is to add an onClick="exit=false" command to each <a href> tag that I want to ignore the popup command.

My problem is that my pop-up script treats the DHTML menus and submenus as if they were <a href> tags and opens my pop-up every time a menu is selected. I don't want this to happen.

Is the onClick="exit=false" command the right code for me to use in the menu_array.js file so that my pop-up will ignore the clicks on the menu?

And if so, where in my menu_array file should I place the onClick="exit=false" command?

Hope someone can help me.

Thanks!

Candy Zulkosky
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 Candy,

I suppose you could surrond the menu item's Description Text (the menu item text) with an <a> tag and but the onClick event in the opening tag, as usual. Like this:

Code: Select all

,"<a onClick='exit=false'>Item Text</a>","theurl.htm",,,1
Don't know if that'd work though.

I think a bigger issue is... What script are you using for the popups? Sounds to me like a huge hassle to have to add something to every <a> tag and every menu item just to prevent something from happening. It's an odd approach to require an event handler to suppress a response; it also generates more code overhead. The more typical approach is to add code only to the tags where you want an event to trigger a response. If this is a script you downloaded, I'd humbly suggest maybe looking for a different script. Are these popups simple text boxes, or are they new windows? If text boxes, you could even co-op the menu code with a few extra functions to have it pop up a text box for you. (If they're popup windows, then they are evil!!! ;) )

Hope that helps,

Kevin
Post Reply