This version of the Delicious website will be shutdown by April 2014.
We encourage users to switch to the new Delicious site at http://delicious.com , which features a responsive design for mobile and tablet users, offline access, faster loading, and more.

Yahoo! UI Library: Menu

http://developer.yahoo.com/yui/menu/

The Menu family of components features a collection of controls that make it easy to add menus to a website or web application. With the Menu Controls you can create website fly-out menus, customized context menus, or application-style menu bars with just a small amount of scripting.

The Menu family of controls features:

Keyboard and mouse navigation.

A rich event model that provides access to all of a Menu instance's interesting moments.

Support for Progressive Enhancement; Menus can be created from simple, semantic markup on the page or purely through JavaScript.

The Menu Family

Menu

Subclass of YAHOO.widget.Overlay. Menu is the base class for all menu containers. The Menu class creates a container that holds a vertical list representing a set of options or commands.

ContextMenu

Subclass of Menu. Creates a list of options or commands that are made visible in response to an HTML element's "contextmenu" event ("mousedown" for Opera).

MenuBar

Subclass of Menu. Horizontal collection of items, each of which can contain a submenu.

Menu Object Model

The following diagrams illustrate the object model for the widgets that compose the Menu family of controls:

Menu Types

Menu Item Types

Each Menu type has a corresponding type for its items.

Submenu Types

Menu instances can be nested inside MenuItem instances to create a menu hierarchy. Each menu item type has a corresponding submenu type.

Getting Started

To use the Menu library, include the following source files in the web page:

Comments