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

clickfunction with Menuitems and type=html


Poster: TonyMontana
Dated: Wednesday January 5 2005 - 21:25:36 GMT

Hello,

i've some problems with the actual version of the menu. I'm using menuitems containing html and the clickfunction but this will not work at the moment. When i change the configuration file to use onfunction instead the custom javascript is executed correcly.

I use the following configuration code:

Code:
   with(milonic=new menuname("PanoIndexPopUp")){
      style=panoMenuStyle;
      overflow="scroll";
      alwaysvisible=1;   
      itemheight=45;
      
      aI("subimage=; subimagepadding=0; itemwidth=145px; type=html; text=<div align=center><font size=1>- Schwarzwald -</font> </div>;url=#");
      aI("clickfunction=alert('test'); itemwidth=145px; type=html;text=<div align=center> <img border=0 src=\"../../pano_01.jpg\"> <br><img border=0 src=\"../../arrow_up.gif\"><font size=1> Startplatz</font> </div>;url=#");
      aI("onfunction=alert('test2');itemwidth=145px; type=html;text= <div align=center><img border=0 src=\"../../dreisam_01.jpg\"><br><img border=0 src=\"../../arrow_up.gif\"><font size=1> Dreisam</font></div>; url=#");
      aI("itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Wellnessbereich -</font></div>;url=../f_pool_01.htm");
   }


I checked the code again and again but didnt find the mistake. Can somebody help?

Regards Tony


Poster: Ruth
Dated: Thursday January 6 2005 - 3:30:28 GMT

One of the other guys might be able to help just looking at what you posted here. If you could post the full menu_data.js file so I can see all the coding I could play with it and see what I find, I can't get it from just the bit you have.

Ruth


Poster: TonyMontana
Dated: Thursday January 6 2005 - 13:36:29 GMT

Hello Ruth,

here is the full content.

Code:

_menuCloseDelay=200           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=1           // The time delay before menus open on mouse over
_subOffsetTop=0              // Sub menu top offset
_subOffsetLeft=0            // Sub menu left offset



with(panoMenuStyle=new mm_style()){
onbgcolor="#000000";
oncolor="#ffffff";
offbgcolor="#ffffff";
offcolor="#000000";
bordercolor="#000000";
borderstyle="solid";
borderwidth=1;
separatorcolor="#000000";
separatorsize="0";
padding=0;
fontsize="75%";
fontstyle="normal";
fontfamily="Arial,Verdana, Tahoma";
pagecolor="black";
pagebgcolor="#ffffff";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="../../grafics/layout/arrow.gif";
subimagepadding="2";

}

with(panoMenuStyleInfo=new mm_style()){
onbgcolor="#ffffff";
oncolor="#000000";
offbgcolor="#ffffff";
offcolor="#000000";
bordercolor="#000000";
borderstyle="solid";
borderwidth=0;
separatorcolor="#000000";
separatorsize="0";
padding=10;
fontsize="75%";
fontstyle="normal";
fontfamily="Arial,Verdana, Tahoma";
pagecolor="black";
pagebgcolor="#000000";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="../../grafics/layout/arrow.gif";
subimagepadding="1";
}

with(panoMenuStyleSize=new mm_style()){
onbgcolor="#000000";
oncolor="#ffffff";
offbgcolor="#ffffff";
offcolor="#000000";
bordercolor="#000000";
borderstyle="solid";
borderwidth=1;
separatorcolor="#000000";
separatorsize="0";
padding=0;
fontsize="60%";
fontstyle="small";
fontfamily="Arial,Verdana, Tahoma";
pagecolor="black";
pagebgcolor="#ffffff";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="../../grafics/layout/arrow.gif";
subimagepadding="0";
}




if ((op7 || op6 || op5 || op ) && ((window.name == 'Quickaccess')))  {
   
   with(milonic=new menuname("PanoIndexPopUp")){
      style=panoMenuStyle;
      overflow="scroll";
      alwaysvisible=1;   
      itemheight=45;
      
      aI("offborder=1px solid #000000;onborder=1px solid #000000;offcolor=#ffffff;offbgcolor=#000000;itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Schwarzwald -</font></div>;url=#");
      aI("clickfunction=alert('test');offborder=1px solid #000000;onborder=1px solid #000000;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><img border=0 src=\"../../projects/bergdemo/images/thumb_145_50_bergdemo_pano_01.jpg\"><br><img border=0 src=\"../../grafics/layout/arrow_up.gif\"><font size=1> Startplatz</font></div>;url=#");
      aI("onfunction=alert('test2');offborder=1px solid #000000;onborder=1px solid #000000;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><img border=0 src=\"../../projects/bergdemo/images/thumb_145_50_bergdemo_dreisam_01.jpg\"><br><img border=0 src=\"../../grafics/layout/arrow_up.gif\"><font size=1> Dreisam</font></div>;url=#");
      aI("offborder=1px solid #000000;onborder=1px solid #000000;itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Wellnessbereich -</font></div>;url=../hoteldemo/f_pool_01.htm");
   }
}
else {
   with(milonic=new menuname("FullQuickAccess")){
      style=panoMenuStyle;
      top=1;
      left=1;
      alwaysvisible=1;
      menuwidth="149px";
      orientation="horizontal";
   
      aI("openonclick=1;clickfunction=popupQuickaccess();onbgcolor=#FFFFFF;image=../../projects/bergdemo/images/thumb_145_50_bergdemo_pano_01_sw.jpg;imagewidth=135px;showmenu=PanoIndex");
   }
   with(milonic=new menuname("PanoIndex")){
      style=panoMenuStyle;
      overflow="scroll";
      alwaysvisible=0;   
      itemheight=45;
      
      aI("pointer=arrow;offborder=1px solid #000000;onborder=1px solid #000000;offcolor=#ffffff;offbgcolor=#000000;itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Schwarzwald -</font></div>;url=#");
      aI("pointer=arrow;offborder=1px solid #000000;onborder=1px solid #000000;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><img border=0 src=\"../../projects/bergdemo/images/thumb_145_50_bergdemo_pano_01.jpg\"><br><img border=0 src=\"../../grafics/layout/arrow_up.gif\"><font size=1> Startplatz</font></div>;url=qtvr_full_bergdemo_startplatz_01.htm");
      aI("pointer=arrow;offborder=1px solid #000000;onborder=1px solid #000000;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><img border=0 src=\"../../projects/bergdemo/images/thumb_145_50_bergdemo_dreisam_01.jpg\"><br><img border=0 src=\"../../grafics/layout/arrow_up.gif\"><font size=1> Dreisam</font></div>;url=qtvr_full_bergdemo_dreisam_01.htm");
      aI("pointer=arrow;offborder=1px solid #000000;onborder=1px solid #000000;itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Wellnessbereich -</font></div>;url=../hoteldemo/f_pool_01.htm");
   }
}


drawMenus();



Thr error take place in the menu directly after the browser check. (i use the menu twice. Once for normal presentation in the main site. Here the menu overlays a quicktime movie. Due to the fact, that i cant bring the menu in front over quicktime in opera, this is solved via a popup, where the menu is loaded in.)
The menu entry directly after the ELSE command also includes a clickfunction which is executed with no error, but it has no type= html.

Thanks for you help

Tony


Poster: TonyMontana
Dated: Thursday January 6 2005 - 13:42:31 GMT

I've just tried version the latest pre-release with no success.
Did this function behave correctly with preavious releases of the menu? This is an essential feature for me.

Regards Tony


Poster: Ruth
Dated: Thursday January 6 2005 - 15:30:37 GMT

Isn't there supposed to be a function?

Ruth


Poster: TonyMontana
Dated: Thursday January 6 2005 - 19:18:41 GMT

Hello Ruth,

for error analysis i've make all functions to do an alert. SO i will explain in greater detail what my problem is. I use colours in the following code, which i will use to easily talk about an specific code fragment.

TonyMontana wrote:

_menuCloseDelay=200 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=1 // The time delay before menus open on mouse over
_subOffsetTop=0 // Sub menu top offset
_subOffsetLeft=0 // Sub menu left offset



with(panoMenuStyle=new mm_style()){
onbgcolor="#000000";
oncolor="#ffffff";
offbgcolor="#ffffff";
offcolor="#000000";
bordercolor="#000000";
borderstyle="solid";
borderwidth=1;
separatorcolor="#000000";
separatorsize="0";
padding=0;
fontsize="75%";
fontstyle="normal";
fontfamily="Arial,Verdana, Tahoma";
pagecolor="black";
pagebgcolor="#ffffff";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="../../grafics/layout/arrow.gif";
subimagepadding="2";

}

with(panoMenuStyleInfo=new mm_style()){
onbgcolor="#ffffff";
oncolor="#000000";
offbgcolor="#ffffff";
offcolor="#000000";
bordercolor="#000000";
borderstyle="solid";
borderwidth=0;
separatorcolor="#000000";
separatorsize="0";
padding=10;
fontsize="75%";
fontstyle="normal";
fontfamily="Arial,Verdana, Tahoma";
pagecolor="black";
pagebgcolor="#000000";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="../../grafics/layout/arrow.gif";
subimagepadding="1";
}

with(panoMenuStyleSize=new mm_style()){
onbgcolor="#000000";
oncolor="#ffffff";
offbgcolor="#ffffff";
offcolor="#000000";
bordercolor="#000000";
borderstyle="solid";
borderwidth=1;
separatorcolor="#000000";
separatorsize="0";
padding=0;
fontsize="60%";
fontstyle="small";
fontfamily="Arial,Verdana, Tahoma";
pagecolor="black";
pagebgcolor="#ffffff";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="../../grafics/layout/arrow.gif";
subimagepadding="0";
}




if ((op7 || op6 || op5 || op ) && ((window.name == 'Quickaccess'))) {

with(milonic=new menuname("PanoIndexPopUp")){
style=panoMenuStyle;
overflow="scroll";
alwaysvisible=1;
itemheight=45;

aI("offborder=1px solid #000000;onborder=1px solid #000000;offcolor=#ffffff;offbgcolor=#000000;itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Schwarzwald -</font></div>;url=#");
aI("clickfunction=alert('test');offborder=1px solid #000000;onborder=1px solid #000000;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><img border=0 src="../../projects/bergdemo/images/thumb_145_50_bergdemo_pano_01.jpg"><br><img border=0 src="../../grafics/layout/arrow_up.gif"><font size=1> Startplatz</font></div>;url=#");
aI("onfunction=alert('test2');offborder=1px solid #000000;onborder=1px solid #000000;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><img border=0 src="../../projects/bergdemo/images/thumb_145_50_bergdemo_dreisam_01.jpg"><br><img border=0 src="../../grafics/layout/arrow_up.gif"><font size=1> Dreisam</font></div>;url=#");
aI("offborder=1px solid #000000;onborder=1px solid #000000;itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Wellnessbereich -</font></div>;url=../hoteldemo/f_pool_01.htm");
}
}
else {
with(milonic=new menuname("FullQuickAccess")){
style=panoMenuStyle;
top=1;
left=1;
alwaysvisible=1;
menuwidth="149px";
orientation="horizontal";

aI("openonclick=1;clickfunction=popupQuickaccess();onbgcolor=#FFFFFF;image=../../projects/bergdemo/images/thumb_145_50_bergdemo_pano_01_sw.jpg;imagewidth=135px;showmenu=PanoIndex");
}

with(milonic=new menuname("PanoIndex")){
style=panoMenuStyle;
overflow="scroll";
alwaysvisible=0;
itemheight=45;

aI("pointer=arrow;offborder=1px solid #000000;onborder=1px solid #000000;offcolor=#ffffff;offbgcolor=#000000;itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Schwarzwald -</font></div>;url=#");
aI("pointer=arrow;offborder=1px solid #000000;onborder=1px solid #000000;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><img border=0 src="../../projects/bergdemo/images/thumb_145_50_bergdemo_pano_01.jpg"><br><img border=0 src="../../grafics/layout/arrow_up.gif"><font size=1> Startplatz</font></div>;url=qtvr_full_bergdemo_startplatz_01.htm");
aI("pointer=arrow;offborder=1px solid #000000;onborder=1px solid #000000;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><img border=0 src="../../projects/bergdemo/images/thumb_145_50_bergdemo_dreisam_01.jpg"><br><img border=0 src="../../grafics/layout/arrow_up.gif"><font size=1> Dreisam</font></div>;url=qtvr_full_bergdemo_dreisam_01.htm");
aI("pointer=arrow;offborder=1px solid #000000;onborder=1px solid #000000;itemheight=15;subimage=;subimagepadding=0;itemwidth=145px;type=html;text=<div align=center><font size=1>- Wellnessbereich -</font></div>;url=../hoteldemo/f_pool_01.htm");
}
}


drawMenus();




Green works, red not. I think the reason that the clickfunction in the ELSE blocks works because it had no type=html. The clickfunction in the upper part uses type=html and the clickfunction isn't fired.

Ideas? Is this a general problem, or did previous releases handle this right?

Regards Tony


Poster: Ruth
Dated: Thursday January 6 2005 - 20:28:09 GMT

Well, the function part is over my head. I substituted a function I had to open a new window and made that the click function, and it seems anyplace I put it that had type=html it stopped working. However, I also removed that type=html from your aI statements and the function then worked. I'm not sure why you have the type=html in the statements. You have url=# specified in the aI string and I don't see that you've placed an a href code anywhere in it for a separate link.

Ruth


Poster: Andy
Dated: Friday January 7 2005 - 8:36:35 GMT

Hi,

Which version of the menu are you using?

Version 5.68 included an openonclick bug fix so anything earlier than 5.68 and this could be a problem.

I also tested your code with the latest version and saw nothing wrong. Might be an idea for you to put something together on the Internet that we can see.

Cheers
Andy