behavior: menu

Popup menu

Elements

that have this behavior applied by default (see master style sheet):

  • <menu class=“popup”>
  • <menu class=“context”>

In principle any element - block container - can have this behavior applied and so to serve as a popup menu.

:!: Menu items: immediate children of the element with behavior:menu applied are treated as menu items if they are:

  • either of type <li>
  • or have attribute role=“menu-item”
  • and not disabled.

Menu items may have sub-menus that are shown as popup windows. Typical structure is:

   <menu .popup> 
     <li>Open</li>
     <li>Close</li>
   </menu>

Popup menus are invisible by default (have display:none defined in master CSS). To show such menu you can use HTMLayoutShowPopup() in htmlayout or to use Element.popup() function in the Sciter. Such behaviors as: popup-menu, popup-selector and menu-bar are aware of the menu - capable to show popup menus.

Attributes

This behavior does not use any special attributes.

Events

Together with the standard set of events (mouse, keyboard, focus) behavior: menu-bar generates:

  • MENU_ITEM_ACTIVE event - mouse is over some menu item. target parameter of the event structure is the active menu item.
  • MENU_ITEM_CLICK event - menu item clicked. target parameter of the event structure is the menu item clicked.
h-smile/built-in-behaviors/menu.txt · Last modified: 2008/07/21 14:06 by andrew
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0