Mozilla XUL Element and Script Reference

Contents  Quick Reference


A container that appears in a child window. The popup window does not have any special frame. Popups can be displayed when an element is clicked by assigning the id of the popup to either the popup, context or tooltip attribute of the element. A popup is a type of box that defaults to vertical orientation.


Attributes inherited from XUL Element


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


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


This event is sent to a popup just before it is popped open. This handler is usually used to dynamically set the contents when the user requests to display it.


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.


The position attribute determines where the popup appears relative to the element the user clicked to invoke the popup.

Properties and Methods:

Properties and Methods inherited from XUL Element


The currently active item within the popup. You can modify this value to select a particular item.

autoPosition    Moz0.9.5
enableKeyboardNavigator ( enable )     Moz0.9.5

enableRollup ( enable )     Moz0.9.5

hidePopup ( )

Closes the popup window immediately.

moveTo ( x , y )     Moz0.9.5

Moves the popup to a new location.

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

Opens a popup window 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.

popup.openPopup (someButton,0,0,"popup","bottomleft","topleft");

This example will open the popup anchored on the bottom-left corner of the button someButton.

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.