I've updated the script to include an option to set the method "toggle" (which is click) or "hover" (which is mouse over/out). It defaults to "toggle". And if the script detects a touch device, it defaults to "toggle" regardless.
This means you could keep the horizontal menu as "hover" activated:
Code:
<script type="text/javascript">
ddsmoothmenu.init({
mainmenuid: "smoothmenu1", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
method: 'hover', //'hover' (mouseover/out) or 'toggle' (click), defaults to 'toggle'
classname: 'ddsmoothmenu', //class added to menu's outer DIV
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
ddsmoothmenu.init({
mainmenuid: "smoothmenu2", //Menu DIV id
orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script>
But I advise against that in this particular case, as with the catalog menu being "toggle", it would be confusing to some. I included the option though because this has been requested in the past and would work out well for folks having all/only "hover" activated menus on a page that want to allow the script to automatically detect touch devices to offer those browsers the "toggle" version.
Right click and 'Save As':
ddsmoothmenu.js
I rethought the z-index issue after noticing that it didn't seem to matter whether the z-indexes were set in ascending or descending order, or even just a fixed value. So I decided to add that as a configurable option fixed value (zindexvalue near the top of the external script with the other configurable options). That way it can be as high as it needs to be to cover other positioned elements if any that might be stacked in the same spot as a drop down/fly out. This is a common requirement for menu scripts and too often is not easily configurable. Now it is for this menu. It can also if required (like in the case of two menus needing the same space at some point) be set as an option individually for each init.
Two more added options:
globaltrackopen - If set to true as it is in the new script, all menus on a page will close previous whenever any menu opens a new menu. Set it to false to have menus act independently in this regard. Has no effect unless 2 or more menus on a page are using the "toggle" method or unless the next option which requires it is used.
closeonnonmenuclick - Also set to true in the script. What this does is if there are one or more "toggle" activated menus on the page and a menu is open and the user clicks anywhere outside the menu, the menu closes. Requires globaltrackopen true.
Bookmarks