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

close sub menus when parent clicked


Poster: jahardman
Dated: Monday November 14 2005 - 2:24:26 GMT

fellow milonic users.

I face a situation I'm sure has a simple solution, but one I haven't stumbled upon yet.

I would like to configure my menu so that when a parent item is clicked the sub menu items below it close automatically. The reason is that users are clicking on the menu item, which takes a second or two to load and before the page loads then clicking on a sub menu item. The problem is that after they click on the sub item the browser has already redirected to the parent item... its causing a lot of confusion.

Is there anyway to create this behavior with milonic menus. A few milisecond delay for the close would be nice, so it feels "natural".

Thanks,
Justin Hardman


Poster: Ruth
Dated: Monday November 14 2005 - 18:33:01 GMT

Hi,

I'm not sure I understand the problem, are you saying that they are clicking on a main menu item before the whole menu is loaded and then because it seems nothing is happening they click a submenu item?

You can set the menuOpenDelay to a higher number so that the submenu won't open so quickly. I'll have to think about the other question, I"m not sure how to do that. If you had a page it would be helpful.

Ruth


Poster: jahardman
Dated: Monday November 14 2005 - 23:02:32 GMT

Ruth,

No, sorry it was a confusing post. Let me clarify what I want, rather than what the problem is:

1. User mouse overs the root level element - child menu items appear
2. User clicks root level element

At this brower starts loading the page that the link points to. I would also like the child menu items to disappear so they are not avaliable for clicking whilst the page is loading.



Ruth wrote:
Hi,

I'm not sure I understand the problem, are you saying that they are clicking on a main menu item before the whole menu is loaded and then because it seems nothing is happening they click a submenu item?

You can set the menuOpenDelay to a higher number so that the submenu won't open so quickly. I'll have to think about the other question, I"m not sure how to do that. If you had a page it would be helpful.

Ruth


Poster: Ruth
Dated: Monday November 14 2005 - 23:28:25 GMT

Hi,

I think this is beyond my knowledge level. However, there are a couple of things you can try. I don't really know if they apply. There is a closeAllMenus() function, and there is one that Kevin wrote for someone who wanted to close a menu on an item being clicked. Perhaps looking at them would tell you something.

http://www.milonic.com/menu_methods.php

http://www.milonic.com/forum/viewtopic. ... 6924#27162

Hope this helps.

From my level, the only things I can think to try would be to make the top level menu non-clickable, putting that link as the first item of the submenu that opens from it, or set the menuCloseDelay to a really small number which means it would close quickly as soon as there is no mouse on it. Sorry I can't be more helpful.

Ruth


Poster: jahardman
Dated: Tuesday November 15 2005 - 7:35:04 GMT

Ruth,

Thanks that was helpful. It dosn't totally help me but is a step in the right direction!

The closeallmenus function does close the menu, when the root item is clicked. However since the mouse is over the menu item when its clicked the menu pops right up again. I guess what I need, upon reflection, is something that disables the menus alltogether when a menu item (any item I suppose) is clicked. This way the user is "committed" to their choice.

Justin

Ruth wrote:
Hi,

I think this is beyond my knowledge level. However, there are a couple of things you can try. I don't really know if they apply. There is a closeAllMenus() function, and there is one that Kevin wrote for someone who wanted to close a menu on an item being clicked. Perhaps looking at them would tell you something.

http://www.milonic.com/menu_methods.php

http://www.milonic.com/forum/viewtopic. ... 6924#27162

Hope this helps.

From my level, the only things I can think to try would be to make the top level menu non-clickable, putting that link as the first item of the submenu that opens from it, or set the menuCloseDelay to a really small number which means it would close quickly as soon as there is no mouse on it. Sorry I can't be more helpful.

Ruth


Poster: Ruth
Dated: Tuesday November 15 2005 - 10:04:57 GMT

Well, since you seem to know more about functions and such, there are a couple of demos that might be of use [not really sure on this] The functions were written by Kevin in response to things someone requested in the forum. I don't know if they apply but maybe they will give you some ideas.

The first, mm_changeItemProperty() allows you to specify a property and have it change to whatever other state you set in the function. There is only one, the first one for the draggable menu that is actually applied in the menu though all can be used through the menu rather than on the pages. Since showmenu is an item property you can perhaps do something with this.

Change Item Properties Demo



In case there might be something else of interest this is the main demo page

and a couple of items from forum posts

show/hide menu through javascript

layers


Sorry I can't be more help on this.

Ruth