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
openonclick property
Poster: nbarth
Dated: Monday November 3 2003 - 23:29:18 GMT
I am wondering if anyone has noticed the difference in the behavior of the onclick property in version 5 as oppose to version 3? When you click on a menu with openonclick set to 1 in version 5 that menu opens, but when you move to another menu with openonclick set to 1 it requires another click to open the menu. In version 3 when you clicked on a menu, that menu opened, however when you moved over another menu it would also open without the requirement of another click. I liked that Has anyone else noticed this, and is there any way to get that functionality back?
Nicholas
Poster: Hergio
Dated: Tuesday November 4 2003 - 4:45:41 GMT
My guess would be that its working as it should in this new version and it was a bug in the version 3 code. heh heh. Depends on how you look at it I guess.
Poster: Andy
Dated: Tuesday November 4 2003 - 16:40:48 GMT
A new variable has now been added to the menu.
Code:
retainClickValue=true;
If this is set, it works as a Windows menu. If not set, it works as it does now.
Should see this in the next release appearing soon.
Cheers
Andy
Poster: nbarth
Dated: Tuesday November 4 2003 - 21:36:06 GMT
Great thanks Andy! I will check it out. Is this version available now or do I have to wait for RC20?
Nicholas
Poster: nbarth
Dated: Tuesday November 4 2003 - 22:11:15 GMT
Andy,
Is retainClickValue set on the menu item, just as openonclick is? I have downloaded the version currently available as of 11/4/2003 __at__ 4:03pm -6:00 GMT. I am setting the openonclick value and the retainClickValue option on the menu item and it doesn't seem to work. Any suggestions?
Code:
with(milonic=new menuname('Menu0')){
left=145;
alwaysvisible=1;
orientation="horizontal";
style=TopMenuStyle;
aI("text=Menu1;status=Menu1;showmenu=Menu1;openonclick=1;retainClickValue=true;");
aI("text=Menu2;status=Menu2;showmenu=Menu3;openonclick=1;retainClickValue=true;");
}
left=145;
alwaysvisible=1;
orientation="horizontal";
style=TopMenuStyle;
aI("text=Menu1;status=Menu1;showmenu=Menu1;openonclick=1;retainClickValue=true;");
aI("text=Menu2;status=Menu2;showmenu=Menu3;openonclick=1;retainClickValue=true;");
}
This is psuedo code, but it demonstrates the idea. I hope I'm not being pushy. I really appreciate you adding the option to do this.
Nicholas
Poster: Hergio
Dated: Tuesday November 4 2003 - 22:13:56 GMT
My initial guess would be to set it in the menu definition itself.
Code:
with(milonic=new menuname('Menu0')){
left=145;
alwaysvisible=1;
orientation="horizontal";
style=TopMenuStyle;
retainClickValue=true;
aI("text=Menu1;status=Menu1;showmenu=Menu1;openonclick=1;");
aI("text=Menu2;status=Menu2;showmenu=Menu3;openonclick=1;");
}
Because all the menu items need to be aware of this setting so they know to open on mouseover when a click has been detected...its a menu wide thing.
left=145;
alwaysvisible=1;
orientation="horizontal";
style=TopMenuStyle;
retainClickValue=true;
aI("text=Menu1;status=Menu1;showmenu=Menu1;openonclick=1;");
aI("text=Menu2;status=Menu2;showmenu=Menu3;openonclick=1;");
}
Poster: nbarth
Dated: Tuesday November 4 2003 - 23:34:33 GMT
Hmm..
That didn't work either.
Nicholas
Poster: Ruth
Dated: Wednesday November 5 2003 - 0:23:27 GMT
I've been following along because it's how I kind of learn things, so just to be straight about what you want....are you trying to tell the menu to accept an onclick and then after that onclick switch to onmouseover? If so how could it work for each item? It would seem that after the first time an onclick was performed that everything else would be onmouseover? Even if it's possible to tell the menu to do that? Or maybe you could set the onclick function for the main menu items and then set all the submenu items with an onfunction telling it to open onmouseover? Sorry if my question is way out in space, I'm not knowledgeable about how these things work and just kind of try to learn things here. Thanks
Ruth
Poster: nbarth
Dated: Wednesday November 5 2003 - 1:39:51 GMT
Ruth,
Once you click on a menu all other menus would open on mouse over until the menuclose time out is reached while not on a menu and then another mouse click would be required to open a menu.
Nicholas
Poster: Hergio
Dated: Wednesday November 5 2003 - 1:46:24 GMT
Try retainClickValue=1; The 'true' thing kinda threw me for a loop because I can't remember too often where andy has used a boolean over an int...
Poster: nbarth
Dated: Wednesday November 5 2003 - 2:10:32 GMT
Neither one works. Hmm... I'm sure Andy knows.
Thanks for trying,
Nicholas
Poster: Andy
Dated: Wednesday November 5 2003 - 17:46:21 GMT
RC20 has just gone up, I'm now waiting for a barrage of complaints
We completely rewote milonic_src.js and some pretty hefty portions of the other files needed changing too so not sure how well this RC will perform.
Tests proved OK but you never can tell.
Anyway, the variable retainClickValue is Global and needs to go at the very top of your data file where _menuCloseDelay is.
I just think it will confuse your users if you have menus operating differently so it's a Global property based on all menus.
Cheers
Andy
Poster: nbarth
Dated: Wednesday November 5 2003 - 19:22:19 GMT
Andy,
Does it need an _? So the variable name would be "_retainClickValue".
Nicholas
Poster: Andy
Dated: Wednesday November 5 2003 - 19:25:47 GMT
retainClickValue=1;
or
retainClickValue=true;
Both are classed as true and will be acceptable.
Cheers
Andy
Poster: nbarth
Dated: Wednesday November 5 2003 - 19:29:09 GMT
Ok, I'll give it a try with RC20.
Nicholas
Poster: nbarth
Dated: Wednesday November 5 2003 - 19:44:12 GMT
Andy,
I tried it . I am currently using RC19, my menus work great. RC20 completely screws them up. If you would like I can apply RC20 to the online example I gave you before and give you a new url. So you would have one for RC19 and one for RC20, that way you could compare and contrast.
Just a thought..
Nicholas
Poster: nbarth
Dated: Wednesday November 5 2003 - 19:57:45 GMT
Andy,
Here are the two urls:
http://login2.call-scheduler.com/menu/rc19/
and
http://login2.call-scheduler.com/menu/rc20/
Hope this helps in the debugging process.
Nicholas