WebFXMenu

This object type is used for menu containers. The menu containers can be populated with menu items.

Constructor

new WebFXMenu()
Name Description
No arguments

Properties

Name Description
id Read only property that can be used to find the related HTMLElement. It can also be used the other way around. If you know the id of the HTMLElement you can get the JS object by looking in the webFXMenuHandler.all collection.
left The left position of the menu. To update the actual position of a shown menu call show again.
top The top position of the menu. To update the actual position of a shown menu call show again.
shown Read only. Boolean property that tells if the menu is shown or not.
borderWidth The width of the left and right borders. This is used to position sub menus correctly. To update this value for all menus either redefine webfxMenuDefaultBorderWidth or override the value on the prototype.
paddingWidth The width of the left and right padding. This is used to position sub menus correctly. To update this value for all menus either redefine webfxMenuDefaultPaddingWidth or override the value on the prototype.
borderTop The height of the top border. This is used to position sub menus correctly. To update this value for all menus either redefine webfxMenuDefaultBorderTop or override the value on the prototype.
paddingTop The height of the top padding. This is used to position sub menus correctly. To update this value for all menus either redefine webfxMenuDefaultPaddingTop or override the value on the prototype.

Methods

Name Description
add(oMenuItem) Adds a menu item to the menu. This method takes one argument and that is the menu item or menu separator to add.
show() Shows the menu and all of its parent menus
hide() Hides the menu and all of its sub menus
hideAllSubs() Hides all sub menus of the current menu
toString() Genereates the HTML string needed to render the menu.

WebFXMenuItem

This object type is used for menu items. The menu item can have a sub menu that will be opened when the item is highlighted.

Constructor

new WebFXMenuItem(sText, sHref, sToolTip, oSubMenu)
Name Description
sText Optional. The HTML string to show on the menu item. If null or left out the default text is used.
sHref Optional. The uri to load when the item is clicked. If null or left out the default uri is used.
sToolTip Optional. The text to show as a tool tip when the user holds the mouse pointer over it. No tool tip is used if this argument is left out or null.
oSubMenu Optional. The sub menu to show when the menu item is selected.

Properties

Name Description
id Read only property that can be used to find the related HTMLElement. It can also be used the other way around. If you know the id of the HTMLElement you can get the JS object by looking in the webFXMenuHandler.all collection.
height The height of the menu item. This is used to position sub menus correctly.
text The HTML string to show on the menu item. If null or left out the default text is used.
href Optional. The uri to load when the item is clicked. If null or left out the default uri is used.
toolTip Optional. The text to show as a tool tip when the user holds the mouse pointer over it. No tool tip is used if this argument is left out or null.
subMenu Optional. The sub menu to show when the menu item is selected.

Methods

Name Description
toString() Genereates the HTML string needed to render the menu item.

WebFXMenuSeparator

This object type is used for menu separators. Separators are usually used to separate different groups of items in a menu.

Constructor

new WebFXMenuSeparator()
Name Description
No arguments

Properties

Name Description
id Read only property that can be used to find the related HTMLElement. It can also be used the other way around. If you know the id of the HTMLElement you can get the JS object by looking in the webFXMenuHandler.all collection.
height The height of the menu separator. This is used to position sub menus correctly.

Methods

Name Description
toString() Genereates the HTML string needed to render the menu item.

WebFXMenuBar

This object type is used for menu bars. The menu bar extends a menu so all properties and methods available on a menu are available to the menu bar. Some caution is due. The position of the default implementation of the menu bar is static so size and position has no real effect.

Constructor

new WebFXMenuBar()
Name Description
No arguments

Properties

Same as for WebFXMenu

Methods

Same as for WebFXMenu

WebFXMenuButton

This object type is used for buttons on a menu bar. The menu button extends the menu item so all properties and methods available on a menu item are available to the menu button. Some caution is due. The height property is not used for anything right now.

Constructor

new WebFXMenuButton(sText, sHref, sToolTip, oSubMenu)

Same as for WebFXMenuItem.

Properties

Same as for WebFXMenuItem

Methods

Same as for WebFXMenuItem

Introduction & Browser Issues
Usage
Implementation
API
Look & Feel
Hover Menu

Author: Erik Arvidsson