YUI recommends YUI3.
YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.
This documentation is no longer maintained.
This example demonstrates how to set MenuItem configuration properties at runtime and listen for the changes through the "configChanged" event.
Note: By default clicking outside of a menu will hide it. Additionally, menu items without a submenu or a URL to navigate to will hide their parent menu when clicked. Click the "Show Menu" button below to make the menu visible if it is hidden.
A MenuItem has a number of configuration
properties that affect its behavior and visual rendering. Any of these
configuration properties can be set at runtime via the
setProperty
method of the item's configuration object
(accessible via its cfg
property.
This example ulitizes the following configuration properties: text, selected, disabled, helptext, url, emphasis, strongemphasis, and checked.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.
Copyright © 2013 Yahoo! Inc. All rights reserved.