| Page 1 of 1 | [ 7 posts ] |
MarcYUI Contributor
|
Hi,
I want to open and close a menu with a click in stead of a mouseover. How can I do this? basically, I want to unregister the mouseover event listener from the menu object. I realize the button class has this behaviour, but I avoided it, because it is based on a select in stead of regular ul/li markup which seems more search engine friendly to me. Kind regards, Marc |
|
Hello Marc,
You're looking for this: autosubmenudisplay http://developer.yahoo.com/yui/docs/YAH ... enudisplay It's a config setting for the menu. Cheers |
|
Marc -
You don't have to use a <select> element in order to get the behavior you want using Button. Here are two examples, the second of which uses a list for the menu: Completely from script: http://yuiblog.com/sandbox/yui/v280/exa ... ple01.html From existing markup: http://yuiblog.com/sandbox/yui/v280/exa ... ple03.html - Todd |
MarcYUI Contributor
|
Didn't know that. Thanks for this. I'll look into replacing the menu with a button, at least it's a smaller library.
Cheers, Marc |
|
I played around with the different configuration options available and for me the best option to use ended up being the following:
autosubmenudisplay: true , showdelay: 0 , hidedelay: 750 , lazyload: true showdelay specifically with default of 250 is too slow and that is when users are observed fumbling around with the animated pull-downs, clicking to "stop" them. Setting autosubmenudisplay to false also works, but then the user has to toggle the hovering on/off which confused a different set of users. |
|
I also observed users and myself to have natural instinct to click to accelerate the opening and instead causing the submenu to close.
autosubmenudisplay can be changed from default of true to false and then it only opens submenus on click-toggle. This gets reset when you hover away from the menu for long enough (or click somewhere else). I felt it is better to keep it on true. showdelay has default of 250 and really the cause of the issue. The setting can be changed to 0 which makes the problem go away. hidedelay I leave at default of 750 which may be too long for some users but it would be too short for others if I reduce it. lazyload seems to be a necessary setting to leave on default of true. Changing this to false makes the menu's work very poorly. |
|
Why can't I just set autoSubmenuDisplay:false and show a menu with a call to
Y.one('#menu').on('click',function(hit){hit.currentTarget.show();} // does not work though it seems like it should I don't want to mouseover to show. I want to click on it. Am I just missing the easy way to do this? |
| Page 1 of 1 | [ 7 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group