pseudoHover: Folding Menu
This implementation the folding menu required no javascript at all to work. Only Internet Explorer 6 and older require a little help in the form of a single classbehaviour script.
The Hover Cascade
The trick behind having this menu operate without any script is the ":hover"-cascade, which in the stylesheet looks something like this:
ul.pseudoHover {}
By stacking the effects of the "li:hover" pseudo-class, the mouse can remain active over list-items to an unlimited depth.
ul.pseudoHover li:hover ul {}
ul.pseudoHover li:hover ul li:hover ul {}
ul.pseudoHover li:hover ul li:hover ul li:hover ul {}
Vertical menu
For the menu every level in the cascade is marked up to be invisible, but visible when the mouse passes over. The result is a folding menu.
For any modern browser except Internet Explorer 6, no javascript is needed. The full functionality is contained in the stylesheet. For Internet Explorer another version of the stylesheet is included that compensates for the loss of the ":hover" functionality by using the class ".hover" and some javascript functions from "classbehaviours.js".
Horizontal menu
With a slight modification to the stylesheet the menu can be arranged in a horizontal layout.
Required Files
-
jQuery Addon Script: jquery.classbehaviours.pseudohover.js (only for MSIE 6)
- Prerequisite Script: jquery.classbehaviours.js (only for MSIE 6)
- Example Markup: pseudoHover.html
- Example Stylesheet: pseudoHover.css
Comments on this Article