# Yahoo! UI Library

### node-menunav 3.0.0

Yahoo! UI Library > node-menunav > plugin.NodeMenuNav
Search:
Filters
Show Private Show Protected Show Deprecated

## Class plugin.NodeMenuNav

The NodeMenuNav class is a plugin for a Node instance. The class is used via the `plug` method of Node and should not be instantiated directly.

### Properties

#### _activeItem - `protected Node`

Node instance representing the menu's active descendent: the menuitem or menu label the user is currently interacting with.
Default Value: null

#### _activeMenu - `protected Node`

Node instance representing the menu that is the parent of the menu's active descendent.
Default Value: null

#### _blockMouseEvent - `protected Boolean`

Boolean indicating whether or not to handle the "mouseover" event.
Default Value: false

#### _currentMouseX - `protected Number`

Number representing the current x coordinate of the mouse inside the menu.
Default Value: 0

#### _firstItem - `protected Node`

Node instance representing the first item (menuitem or menu label) in the root menu of a menu.
Default Value: null

#### _hasFocus - `protected Boolean`

Boolean indicating if the menu has focus.
Default Value: false

#### _hideAllSubmenusTimer - `protected Object`

Timer used to hide a all submenus.
Default Value: null

#### _hideSubmenuTimer - `protected Object`

Timer used to hide a submenu.
Default Value: null

#### _movingToSubmenu - `protected Boolean`

Boolean indicating if the mouse is moving from a menu label to its corresponding submenu.
Default Value: false

#### _rootMenu - `protected Node`

Node instance representing the root menu in the menu.
Default Value: null

#### _showSubmenuTimer - `protected Object`

Timer used to show a submenu.
Default Value: null

#### NodeMenuNav.SHIM_TEMPLATE - `String`

String representing the HTML used to create the `<iframe>` shim used to prevent `<select>` elements from poking through menus in IE 6.
Default Value: "<iframe frameborder="0" tabindex="-1" class="yui-shim" title="Menu Stacking Shim" src="javascript:false;"></iframe>"

#### NodeMenuNav.SHIM_TEMPLATE_TITLE - `String`

String representing the value for the `title` attribute for the shim used to prevent `<select>` elements from poking through menus in IE 6.
Default Value: "Menu Stacking Shim"

### Methods

#### _afterActiveDescendantChange

`protected void _afterActiveDescendantChange ( event , menuNav )`
"activeDescendantChange" event handler for menu's Focus Manager.

Parameters:
  `event <Object>` Object representing the Attribute change event.
  `menuNav <NodeMenuNav>` Object representing the NodeMenuNav instance.

#### _cancelHideSubmenuTimer

`protected void _cancelHideSubmenuTimer ( )`
Cancels the timer used to hide a submenu.

#### _cancelShowSubmenuTimer

`protected void _cancelShowSubmenuTimer ( )`
Cancels the timer used to show a submenu.

#### _clearActiveItem

`protected void _clearActiveItem ( )`
Clears the menu's active descendent.

#### _focusItem

`protected void _focusItem ( item )`
Focuses the specified menuitem or menu label.

Parameters:
  `item <Node>` Node instance representing a menuitem or menu label.

#### _getTopmostSubmenu

`protected Node _getTopmostSubmenu ( menu )`
Returns the topmost submenu of a submenu hierarchy.

Parameters:
  `menu <Node>` Node instance representing a menu.

Returns: `Node`
  Node instance representing a menu.

#### _hideAllSubmenus

`protected void _hideAllSubmenus ( menu )`
Hides all submenus of the specified menu.

Parameters:
  `menu <Node>` Node instance representing a menu.

#### _hideAndFocusLabel

`protected void _hideAndFocusLabel ( )`
Hides all of the submenus of the root menu and focuses the label of the topmost submenu

#### _hideMenu

`protected void _hideMenu ( menu , activateAndFocusLabel )`
Hides the specified menu.

Parameters:
  `menu <Node>` Node instance representing a menu.
  `activateAndFocusLabel <Boolean>` Boolean indicating if the label for the specified menu should be focused and set as active.

#### _initFocusManager

`protected void _initFocusManager ( )`
Initializes and updates the Focus Manager so that is is always managing descendants of the active menu.

#### _isRoot

`protected Boolean _isRoot ( menu )`
Returns a boolean indicating if the specified menu is the root menu in the menu.

Parameters:
  `menu <Node>` Node instance representing a menu.

Returns: `Boolean`
  Boolean indicating if the specified menu is the root menu in the menu.

#### _onActiveDescendantChange

`protected void _onActiveDescendantChange ( event , menuNav )`
"activeDescendantChange" event handler for menu's Focus Manager.

Parameters:
  `event <Object>` Object representing the Attribute change event.
  `menuNav <NodeMenuNav>` Object representing the NodeMenuNav instance.

#### _onDocFocus

`protected void _onDocFocus ( event )`
"focus" event handler for the owner document of the MenuNav.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _onDocMouseDown

`protected void _onDocMouseDown ( event )`
"mousedown" event handler for the owner document of the menu.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _onHorizontalMenuKeyDown

`protected void _onHorizontalMenuKeyDown ( event )`
"keydown" event handler for horizontal menus.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _onKeyDown

`protected void _onKeyDown ( event )`
"keydown" event handler for the menu.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _onKeyPress

`protected void _onKeyPress ( event )`
"keypress" event handler for the menu.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _onMenuItemMouseOut

`protected void _onMenuItemMouseOut ( menuItem , event )`
"mouseout" event handler for a menuitem.

Parameters:
  `menuItem <Node>` Node instance representing a menuitem.
  `event <Object>` Object representing the DOM event.

#### _onMenuItemMouseOver

`protected void _onMenuItemMouseOver ( menuItem , event )`
"mouseover" event handler for a menuitem.

Parameters:
  `menuItem <Node>` Node instance representing a menuitem.
  `event <Object>` Object representing the DOM event.

#### _onMenuLabelMouseOut

`protected void _onMenuLabelMouseOut ( menuLabel , event )`
"mouseout" event handler for a menu label.

Parameters:
  `menuLabel <Node>` Node instance representing a menu label.
  `event <Object>` Object representing the DOM event.

#### _onMenuLabelMouseOver

`protected void _onMenuLabelMouseOver ( menuLabel , event )`
"mouseover" event handler for a menu label.

Parameters:
  `menuLabel <Node>` Node instance representing a menu label.
  `event <Object>` Object representing the DOM event.

#### _onMenuMouseOut

`protected void _onMenuMouseOut ( menu , event )`
"mouseout" event handler for a menu.

Parameters:
  `menu <Node>` Node instance representing a menu.
  `event <Object>` Object representing the DOM event.

#### _onMenuMouseOver

`protected void _onMenuMouseOver ( menu , event )`
"mouseover" event handler for a menu.

Parameters:
  `menu <Node>` Node instance representing a menu.
  `event <Object>` Object representing the DOM event.

#### _onMouseMove

`protected void _onMouseMove ( event )`
"mousemove" event handler for the menu.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _onMouseOut

`protected void _onMouseOut ( event )`
"mouseout" event handler for the menu.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _onMouseOver

`protected void _onMouseOver ( event )`
"mouseover" event handler for the menu.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _onVerticalMenuKeyDown

`protected void _onVerticalMenuKeyDown ( event )`
"keydown" event handler for vertical menus.

Parameters:
  `event <Object>` Object representing the DOM event.

#### _setActiveItem

`protected void _setActiveItem ( item )`
Sets the specified menuitem or menu label as the menu's active descendent.

Parameters:
  `item <Node>` Node instance representing a menuitem or menu label.

#### _showMenu

`protected void _showMenu ( menu )`
Shows the specified menu.

Parameters:
  `menu <Node>` Node instance representing a menu.

#### _toggleSubmenuDisplay

`protected void _toggleSubmenuDisplay ( event )`
"mousedown," "keydown," and "click" event handler for the menu used to toggle the display of a submenu.

Parameters:
  `event <Object>` Object representing the DOM event.

### Events

#### autoSubmenuDisplayChange

`autoSubmenuDisplayChange ( event )`
Fires when the value for the configuration attribute 'autoSubmenuDisplay' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### mouseOutHideDelayChange

`mouseOutHideDelayChange ( event )`
Fires when the value for the configuration attribute 'mouseOutHideDelay' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### submenuHideDelayChange

`submenuHideDelayChange ( event )`
Fires when the value for the configuration attribute 'submenuHideDelay' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### submenuShowDelayChange

`submenuShowDelayChange ( event )`
Fires when the value for the configuration attribute 'submenuShowDelay' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### useARIAChange

`useARIAChange ( event )`
Fires when the value for the configuration attribute 'useARIA' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

### Configuration Attributes

#### autoSubmenuDisplay `- writeonce boolean`

Boolean indicating if submenus are automatically made visible when the user mouses over the menu's items.
Default Value: true

#### mouseOutHideDelay `- writeonce Number`

Number indicating the time (in milliseconds) that should expire before a submenu is hidden when the user mouses out of it.
Default Value: 750

#### submenuHideDelay `- writeonce Number`

Number indicating the time (in milliseconds) that should expire before a submenu is hidden when the user mouses out of a menu label heading in the direction of a submenu.
Default Value: 250

#### submenuShowDelay `- writeonce Number`

Number indicating the time (in milliseconds) that should expire before a submenu is made visible when the user mouses over the menu's label.
Default Value: 250

#### useARIA `- writeonce boolean`

Boolean indicating if use of the WAI-ARIA Roles and States should be enabled for the menu.
Default Value: true

Copyright © 2009 Yahoo! Inc. All rights reserved.