close sub menus when parent clicked

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
jahardman
Beginner
Beginner
Posts: 7
Joined: Mon Nov 14, 2005 3:16 am

close sub menus when parent clicked

Post by jahardman »

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
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
jahardman
Beginner
Beginner
Posts: 7
Joined: Mon Nov 14, 2005 3:16 am

Post by jahardman »

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
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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://milonic.com/menu_methods.php

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
jahardman
Beginner
Beginner
Posts: 7
Joined: Mon Nov 14, 2005 3:16 am

Post by jahardman »

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://milonic.com/menu_methods.php

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
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
Post Reply