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

prevent submenu close onclick when it has submenus


Poster: cmanley
Dated: Wednesday June 14 2006 - 22:32:33 BST

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.


Poster: Ruth
Dated: Friday June 16 2006 - 5:19:38 BST

Hi,


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


Poster: cmanley
Dated: Friday June 16 2006 - 14:41:27 BST

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


Poster: Ruth
Dated: Friday June 16 2006 - 18:01:50 BST

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


Poster: cmanley
Dated: Tuesday June 20 2006 - 21:57:11 BST

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


Poster: Ruth
Dated: Wednesday June 21 2006 - 0:50:47 BST

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


Poster: cmanley
Dated: Wednesday June 21 2006 - 14:24:38 BST

Cool thanks, that worked!