openonclick property

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

openonclick property

Post by nbarth »

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
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

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.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

A new variable has now been added to the menu.

Code: Select all

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
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

Great thanks Andy! I will check it out. Is this version available now or do I have to wait for RC20?

Nicholas
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

Andy,

Is retainClickValue set on the menu item, just as openonclick is? I have downloaded the version currently available as of 11/4/2003 @ 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: Select all

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;");
}
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
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

My initial guess would be to set it in the menu definition itself.

Code: Select all

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.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

Hmm..

That didn't work either.

Nicholas
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

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
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

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...
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

Neither one works. Hmm... I'm sure Andy knows.

Thanks for trying,
Nicholas
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

RC20 has just gone up, I'm now waiting for a barrage of complaints :P

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
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

Great thanks Andy!

Nicholas :)
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

Andy,

Does it need an _? So the variable name would be "_retainClickValue".

Nicholas
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

retainClickValue=1;

or

retainClickValue=true;

Both are classed as true and will be acceptable.

Cheers
Andy
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

Ok, I'll give it a try with RC20.

Nicholas
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

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
User avatar
nbarth
Super Advanced
Super Advanced
Posts: 41
Joined: Tue Jul 29, 2003 11:03 am
Location: Minnesota
Contact:

Post by nbarth »

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
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Andy wrote:A new variable has now been added to the menu.

Code: Select all

retainClickValue=true;
Nice touch Andy :) . I think this will be a very useful option and plan to use it myself.

Keep up the great work! Your efforts are appreciated.

Kevin
Post Reply