Javascript as a menu item

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
stephen702
Super Advanced
Super Advanced
Posts: 77
Joined: Wed Jul 16, 2003 4:53 am
Location: Davis, CA
Contact:

Javascript as a menu item

Post by stephen702 »

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.
Shap5202
Super Advanced
Super Advanced
Posts: 62
Joined: Thu Sep 29, 2005 2:36 pm

Post by Shap5202 »

Code: Select all

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.
User avatar
stephen702
Super Advanced
Super Advanced
Posts: 77
Joined: Wed Jul 16, 2003 4:53 am
Location: Davis, CA
Contact:

Post by stephen702 »

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.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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

Ruth
User avatar
stephen702
Super Advanced
Super Advanced
Posts: 77
Joined: Wed Jul 16, 2003 4:53 am
Location: Davis, CA
Contact:

Post by stephen702 »

Ruth--

This works. Thanks!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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.
Post Reply