Mozilla XUL Element and Script Reference

Contents  Quick Reference

Menupopup

A container used to display menus. It should be placed inside a menu, menulist, or menubutton element. It can contain any element but usually will contain menuitem elements. It is a type of box that defaults to vertical orientation.

Attributes:

Attributes inherited from XUL Element

oncontextmenu

This event is sent to an element when the user requests to open the context menu for the element. The action to do this varies by platform, but it will typically be a right click. This handler is usually used to dynamically set the commands on a menu when the user requests to display it, or you can use onpopupshowing event. Returning false from this event handler prevents the popup from appearing.

onpopuphidden

This event is sent to a popup after it has been hidden.

onpopuphiding

This event is sent to a popup when it is about to be hidden.

onpopupshowing

This event is sent to a menupopup just before it is popped open. This handler is usually used to dynamically set the commands on a menu when the user requests to display it. Returning false from this event handler prevents the popup from appearing.

onpopupshown

This is event is sent to a popup after it has been opened, much like the onload event is sent to a window when it is opened.

position

The position attribute determines where the popup appears relative to the element the user clicked to invoke the popup. This allows you to place the menu on one side on a button.

Properties and Methods:

Properties and Methods inherited from XUL Element

activeChild

The currently active menu item. You can modify this value to select a particular menu item.

autoPosition    Moz0.9.5
closePopup ( )

Closes the popup menu immediately.

enableKeyboardNavigator ( enable )     Moz0.9.5

enableRollup ( enable )     Moz0.9.5

moveTo ( x , y )     Moz0.9.5

Moves the popup to a new location.

openPopup ( element, x , y , popupType, anchor, align )

Opens a popup menu at the position (x,y) relative to the element. Type should be either the string "popup", "context" or "tooltip". The parameter anchor corresponds to the popupanchor attribute on the element. The parameter align corresponds to the popupalign attribute on the element.

popupBoxObject    Moz0.9.5

This read-only property holds the nsIPopupBoxObject that implements the popup.

sizeTo ( width , height )     Moz0.9.5

Changes the current size of the popup to a new width and height.