Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:27

Javascript Function as menu item URL?


Poster: jondoe_264
Dated: Wednesday May 26 2004 - 13:49:00 BST

Here's what I'm trying to acheive:

A sub-menu item when clicked opens a new browser window via a javascript function that is referenced to from the html page that the main menu is part of.

Where in the sub-menu items code do I need to put the javasript? What would the syntax look like? Is this even possible? I was thinking may be in the URL attribute?

aI("text=3200;url=javascript:launchSharewire(PRODUCT_ID);status=3200;");

What you think anybody?


Poster: Maz
Dated: Wednesday May 26 2004 - 15:36:15 BST

You might find an example of what you are looking for by searching the forum. I'm sure this topic has come up before.

maz


Poster: kevin3442
Dated: Wednesday May 26 2004 - 15:46:20 BST

Jondoe,

The syntax in your example is exactly correct. Another method, if you want to use a different url in conjunction with an onclick handler, is to use the clickfunction property, like so:
Code:
aI("text=Item text;url=theURL.html;clickfunction=launchSharewire(PRODUCT_ID);status=3200;");

You can also use the clickfunction property in the absence of the url property.
Code:
aI("text=Item text;clickfunction=launchSharewire(PRODUCT_ID);status=3200;");

You may also want to refer to this sample to learn about onmouseover (onfunction) and onmouseout (offfunction) capabilities.

Hope that helps,

Kevin