prevent submenu close onclick when it has submenus

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
cmanley
Advanced
Advanced
Posts: 12
Joined: Sat May 13, 2006 3:35 am

prevent submenu close onclick when it has submenus

Post by cmanley »

Hi,

I want to make my menus work just as they do on the Windows desktop... that means if I click on a menuitem that has a submenu, then I don't want the current open menu to close.

Is there a way to do this because it's irritating to users when they open a deep nested menu structure halfway and it all closes because they happened to click on one of the menuitems just as they normally are used to doing in Windows.

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

Post by Ruth »

Hi,

Code: Select all

Boolean retainClickValue

Menus that are opened using a click event as opposed to mouse over event have two type of actions.

The most common type of click menu is one that opens a sub menu 'on click' but all sibling sub menus are opened on 'mouse over' until either a selection is made or the mouse pointer moves away from focus.

This type of menu is used on almost all desktop applications and is probably the style of click menu you'll want to use. To declare this type of click menu you will need specify retainClickValue as true because the menu, by default, will require a click for every menu that requires a click to open it. 

Valid syntax is retainClickValue = true;

That goes in the 'global' properties area, the one with menuCloseDelay, menuOpenDelay etc.

If you go to the mian Milonic site, there is a link under DHTML Menu that says Menu Quick Reference Guides. The bottom four are pretty useful for most menu users. The top two are a bit more involved, talking about functions and integers and such.

Hope that helps

Ruth
cmanley
Advanced
Advanced
Posts: 12
Joined: Sat May 13, 2006 3:35 am

Post by cmanley »

Hi Ruth,

I've tried that already but it had no effect. I've also tried adding "closeonclick=0;" to all the style and menu objects, but that had no effect either. It would be nice if there were some menu examples that demonstrated if and how this can be done.

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

Post by Ruth »

Hi,

Can you provide a url, please. That particular code makes the menu work just like IE works when you go to the File/Edit/View etc. For example, you click on View and that opens the submenu, then mouseover Toolbars and the submenu for that opens and the original submenu that has the Toolbars item in it remains open.

Looking at the page would be much easier since we could then see your menu_data.js file and coding.

Ruth
cmanley
Advanced
Advanced
Posts: 12
Joined: Sat May 13, 2006 3:35 am

Post by cmanley »

Hi,

The URL of the site in development is:
http://mosavizion.dyndns.org/

I've added a test menu for you.
If you navigate via the menu "Bedrijfsprofiel" to "Test" to "Nothing Special", and you click on the "Test" submenu, then it'll close.

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

Post by Ruth »

Hi,

You can set your aI which opens that test submenu to openonclick=1; that means it will open the submenu on click rather than close all the menus.

Code: Select all

with(new menuname("Bedrijfsprofiel")){
overflow="scroll";
style=menuStyleSub;
aI("text=Waarom mosavIZIon;url=/content.php?id=BedrijfsProfiel_Waarom");
aI("text=Hoe werkt mosavIZIon;url=/content.php?id=BedrijfsProfiel_Hoe");
aI("text=Over ons;url=/content.php?id=BedrijfsProfiel_Over");
aI("showmenu=Test;text=Test;openonclick=1;");
}
Ruth
cmanley
Advanced
Advanced
Posts: 12
Joined: Sat May 13, 2006 3:35 am

Post by cmanley »

Cool thanks, that worked!
Post Reply