Active
Project:
Dynamic Persistent Menu
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2009 at 00:30 UTC
Updated:
17 Sep 2012 at 00:25 UTC
How much effort would be involved in changing the hover behavior to onclick?
Comments
Comment #1
johnhanley commentedShame on me for not looking at dynamic_persistent_menu.js prior to asking!
To change the navigation behavior from hover to onclick, simply change the method on line 8 from "mouseover" to "click" like so
Perhaps a nice feature would be to add this as a configurable option.
Comment #2
Sinan Erdem commentedHi...
Sorry for reopening such an old issue but... I want the sub-menu close if a user clicks on the parent menu item again. I mean a click will toggle the visibility of the sub-menu. Can you think of any solutions to this?
Also I want the sub-menu stay opened. I changed the "Sub-menu timeout" to a very large number. It works, but is it a good solution in terms of performance or something??
Thanks already...
Comment #3
jenlamptonI would also like the ability to choose between a hover-driven or click-driven display change for the sub-menus. This is particularly useful if you are looking for a drop-down menu that will work on tablets, or touch-devices that do not have a hover state.
I ended up also making the same hack as in #1.
In addition, we did not want the child-menu to display automatically for any given section - we wanted the sub-menus to *only* be visible when the parent link was clicked, so we also changed line 120 of the .module file to always, always hide the child menu, as follows:
And then in the .js file I had to change dynamic_persistent_menu_reset function NOT to show the sub-menu.
But, that is a whole other issue. Please see #1211764: Provide different options for how the sub-menus are displayed