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:03

trying to add this to a menu link how is it done?


Poster: douza
Dated: Saturday October 18 2003 - 18:26:16 BST

trying to add this to a menu link how is it done?

Quote:

<a HREF onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.mydomain.co.uk');">Set Homepage</a>


any help will be great

Marshy


Poster: Hergio
Dated: Sunday October 19 2003 - 4:27:16 BST

Try this....

In menu_data...
Code:
function doSomething( vThis )
{
   vThis.style.behavior="url(#default#homepage)";
   vThis.setHomePage("http://www.mydomain.co.uk");
}

///new menu item(){ blah blah...
...
...
aI("text=Set Homepage;url=doSomething(this);");
...}


Poster: douza
Dated: Sunday October 19 2003 - 18:08:44 BST

dosn't work just get error msg below

Image

Line:43
Error: 'style' is null or not an object

Any more help?

thanks

Marshy


Poster: douza
Dated: Monday October 20 2003 - 20:25:11 BST

Anybody know how to add this link to the menu,,,,Hergio


Poster: John
Dated: Tuesday October 21 2003 - 22:31:10 BST

If and when somebody has an answer for you it will be posted. Adding another topic and copying all the messages simply wastes everybody's time and will not make things happen any faster. That's why it has been deleted.


Poster: rhodos
Dated: Thursday November 6 2003 - 7:21:37 GMT

Hey douza,
have you got a solution for this problem yet? would be very nice for me too...
Ciao
Thomas


Poster: Hergio
Dated: Friday November 7 2003 - 3:13:37 GMT

Boy am I stupid, there are two things you can do...one if fix my last but of code I sent, I believe it was wrong. Should be...
Code:
function doSomething( vThis )
{
   vThis.style.behavior="url(#default#homepage)";
   vThis.setHomePage("http://www.mydomain.co.uk");
}

///new menu item(){ blah blah...
...
...
aI("text=Set Homepage;url=javascript:doSomething(this);");
...}

...notice the javascript: before the doSomething, was missing that.

The other is that there is now an onClick event you can catch in the menu items. Its called clickFunction and it will execute any bit of javascript you;d like as if it was put in the onClick of the link in the menu. Good luck and sorry about that stupid error.