Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Last Updated: Wednesday December 3 2008 - 06:12:11
OnClick Function Duplication
Poster: bobwill
Dated: Saturday February 9 2008 - 15:27:00 UTC
I am trying to duplicate the "onclick" function in the Milonic Menu
The following line of code is an example of the html code that I am trying to duplicate. Not the file or URL as shown in the example, but the process as shown.
<a href="http://www.example.com" onClick="javascript: pageTracker._trackPageview('/outgoing/example.com');">
Here is my Milonic menu code.
aI("text=New Helmet Rule;url=/forms/helmet_rule.doc;status=New Helmet Rule;separatorsize=1;");
Is the following line the correct Milonic replacement code?
aI("text=New Helmet Rule;url=/forms/helmet_rule.doc;clickfunction=javascript: pageTracker._trackPageview('/forms/helmet_rule.doc') status=New Helmet Rule;separatorsize=1;");
Re: OnClick Function Duplication
Poster: Ruth
Dated: Sunday February 10 2008 - 9:40:52 UTC
Hiya Bob,
Well, since I don't do much js, and since I'd need some kind of 'function' to test I can only say that to me it looks as if that should work. That is how you set up a click function, so if the function is available to be triggered by the click, then I would think that the url part of the aI would open the doc, and the click function part would trigger the function when you clicked to open the doc. If you can't get it to work and you don't get a more definitive response here in a bit, I can only suggest that you contact Milonic directly. I will try to find some function out on the web to use and set up a click function plus say a pdf file to open and see what happens.
Ruth
Re: OnClick Function Duplication
Poster: bobwill
Dated: Sunday February 10 2008 - 15:29:29 UTC
OK, thanks Ruth
This has to do with Google Analytics for me to track files that are being downloaded.
Re: OnClick Function Duplication
Poster: Andy
Dated: Friday February 15 2008 - 13:09:26 UTC
Hi,
You don't need the javascript: setting for clickfunction, you've also got a space in there, try this instead:
Code:
aI("text=New Helmet Rule;url=/forms/helmet_rule.doc;clickfunction=pageTracker._trackPageview('/forms/helmet_rule.doc');separatorsize=1;");
HTH,
Andy
Re: OnClick Function Duplication
Poster: bobwill
Dated: Friday February 15 2008 - 13:35:55 UTC
Thanks Andy. I will give it a try. I had already caught the blank space and replaced it with a semi-colon. I will remove the "javascript" statement and see how things go.
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
