A jQuery Plugin for no-click two-level menus
(or whatever else you want to do with it)
This is yet another accordion script, except you don’t have to click to open one item, you just move your mouse over it.
I actually made the plugin to serve as a menu, but it could also work as a regular accordion for displaying different types of content within a page.
It was important to me to require as little customization of the list code in order for the plugin to work, i.e. I didn’t want to have to manually add classes etc. to header or active elements, as the structure of the list already contains all the information needed.
This plugin requires an unordered list with two levels.
To use the plugin with the list, call it by referencing the id of the
Example #1 – Menu
Just a plain unordered list with the id ‘example1’ in the
Example #2 – Regular Accordion
This time, we’ll set custom options to emulate the accordion from the Apple website.
For this example, a few extra classes are attached to the first and last items, so that the background images change according to their position (note the rounded corners).