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 as a menu item


Poster: stephen702
Dated: Wednesday November 2 2005 - 16:56:09 GMT

I've read your online documentation, but am still baffled about how to turn the following javascript into a Milonic menu item:


<!--[if IE]>
<A HREF="#"
onClick="this.style.behavior='url(#default#homepage)';
this.setHomePage('http://www.aact.org');">
Make This Your Home Page
</A>
<![endif]-->


Any help would be appreciated.


Poster: Shap5202
Dated: Wednesday November 2 2005 - 18:09:45 GMT

Code:
aI("text=Make This Your Home Page;clickfunction=this.style.behavior='url(#default#homepage)';
this.setHomePage('http://www.aact.org');");


that may or may not actually work as written, but is the equivalent to the code your pasted. clickfunction is invoked when the user clicks on that particular item. So you can modify that as you see fit.


Poster: stephen702
Dated: Thursday November 3 2005 - 16:05:08 GMT

Thanks for the suggetion. Unfortunately, the coding suggested above caused my entire menu to disappear from the screen. This is the same problem I had when I was experimenting with putting a javascript into a menu item.

It's a bit frustrating, because I don't know which of the pieces is causing the problem. I've tried changing different elements in the item code, but nothing works.


Poster: Ruth
Dated: Thursday November 3 2005 - 19:41:53 GMT

Demo: Set As Home Page The set as homepage function only works in IE

Ruth


Poster: stephen702
Dated: Friday November 4 2005 - 0:09:58 GMT

Ruth--

This works. Thanks!


Poster: Ruth
Dated: Friday November 4 2005 - 0:58:43 GMT

There are two more, sort of related to this.

Add To Favorites - works in IE only

Add To SideBar - works in Netscape and FireFox, it's more involved than the add to favorites but it gives you the ability to allow people to add a tab in their sidebar which would contain the link for your site.