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
Industrial Strength JavaScript and DHTML Menus
About Us
Testimonials
Contact Us
Our Distinguished Clients
Investing in Non-Profits
Where Are We
Privacy Policy
Software Licensing Agreement
DHTML JavaScript Menu
Product Information
Page Integration
Quick Reference Guides
Embedding Into a Table or DIV
Purchase
