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

Calling a menu item from Javascript


Poster: tjw2006
Dated: Friday March 9 2007 - 11:39:10 GMT

Hi, does anyone know if it's possible to emulate the onclick event of a menu item from Javascript - so basically firing the function within the correct .js script to redirect to a URL for instance?

Thanks in advance.
Tim

hmmm....


Poster: tjw2006
Dated: Friday March 9 2007 - 16:58:50 GMT

Has anybody got any ideas at all on how to do this?


Poster: Ruth
Dated: Friday March 9 2007 - 17:34:34 GMT

Hi,

I don't understand what you are asking. Do you want to put a onclick event in an html link? Or do you want to open a submenu from an html link onclick?

Ruth

Wel...


Poster: tjw2006
Dated: Monday March 12 2007 - 9:36:18 GMT

...all I want to be able to do is to simulate the click event of a menu item from a Javascript function.


Poster: Ruth
Dated: Monday March 12 2007 - 14:24:04 GMT

Hi,

I still am not sure what you want to do, but you can use the offfunction/onfunction to activate a function on mouseover which is this sample.

http://www.milonic.com/menusample15.php

You can also set up a function to be activated when you click a link in the menu. For example, you could have a new window function such as
Code:
var newwindow;
function poptastic(url)
{
   newwindow=window.open(url,'name','height=500,width=400,left=100,
  top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');

}


Then in the aI string you'd put this in the url= area

Code:
url=javascript:newwindow('http://whatever/');");


Ruth