Keyboard Accessible Dropdown Menu, Part Deux

This is my take on the famous suckerfish dropdowns.

This menu is fully keyboard accessible and can have an infinite level of sub-menus. It is also keyboard accessible to modern browsers when JavaScript is disabled.

Using this menu is easy, simply include the JavaScript file in the head of your document, then after your drop down menu (or on page load, whatever method you prefer) call the dropdown() function.

The dropdown() function takes three parameters: the ID of the dropdown menu, the class you wish to apply to list items when they are active, and the mouse off delay. An example call looks like:

<script type="text/javascript">dropdown('nav', 'hover', 250);</script>

This means the dropdown menu will apply to the list with an ID of nav. When you hover over a list item it will have the class hover applied to it, and that class will stay on the list item for 250ms after you mouse off.

Why use this menu?


Keyboard Accessible Dropdown Menu, Part Deux by Blake Haswell. Questions or comments? E-mail me.