This element is used for the tooltip popups. For text-only tooltips, this element doesn't need to be used; instead you may just add a tooltiptext
attribute to an element.
More information is available in the XUL tutorial.
<tooltip id="moretip" orient="vertical" style="background-color: #33DD00;"> <label value="Click here to see more information"/> <label value="Really!" style="color: red;"/> </tooltip> <vbox> <button label="Simple" tooltiptext="A simple popup"/> <button label="More" tooltip="moretip"/> </vbox>
crop
crop
attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.start
end
left
right
center
none
none
and the displayed text is larger than this maximum width, you may be able to use the max-width CSS property (or the maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value none
:menupopup > menuitem, menupopup > menu { max-width: none; }
noautohide
false
or omitted, the tooltip
will automatically disappear after a few seconds. If this attribute is set to true
, this will not happen and the tooltip will only hide when the user moves the mouse to another element.onpopuphiding
onpopupshowing
false
from this event handler prevents the popup from appearing.onpopupshown
onload
event is sent to a window when it is opened.page
page
attribute to true will result in the tooltip being filled automatically as appropriate for a browser
content area tooltip, i.e. the tooltip text is set according to the DOM element in the browser that the user hovered over.<tooltip id="pageTooltip" page="true"/> <browser tooltip="pageTooltip"/>
position
position
attribute determines where the popup appears relative to the element the user clicked to invoke the popup. This allows you to place the popup on one side of a button. Note that a context menu will never respect this attribute, always appearing relative to the mouse cursor.topleft
, topright
, bottomleft
, bottomright
, leftcenter
, rightcenter
, topcenter
or bottomcenter
. The popup value (ie, the second word) can be one of topleft
, topright
, bottomleft
or bottomright
.after_start
, after_end
, before_start
, before_end
, end_after
, end_before
, start_after
, start_before
, overlap
, at_pointer
or after_pointer
.accessibleType
popupBoxObject
nsIPopupBoxObject
nsIPopupBoxObject
that implements the popup. You wouldn't normally need to use this property as all of its functions are available via the popup itself.state
closed
: The popup is closed and not visible.open
: The popup is open and visible on screen.showing
: A request has been made to open the popup, but it has not yet been shown. This state will occur during the popupshowing event.hiding
: The popup is about to be hidden. This state will occur during the popuphiding event.hidePopup()
moveTo( x, y )
openPopup( anchor , position , x , y , isContextMenu, attributesOverride, triggerEvent )
Opens the popup relative to a specified node at a specific location.
null
as the anchor node. The direction in which the popup is oriented depends on the direction of the anchor.before_start
, before_end
, after_start
, after_end
, start_before
, start_after
, end_before
, end_after
, overlap
, and after_pointer
. Check Positioning of the Popup Guide for a precise description of the effect of the different values.x
and y
arguments may be used to offset the popup from its anchored position by some number, measured in CSS pixels. An unanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. In this case, the position
and attributesOverride
arguments are ignored.isContextMenu
argument should be true
for context menus and false
for all other types of popups. It affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items.attributesOverride
argument is true
, the position attribute on the popup node overrides the position
value argument. If attributesOverride
is false
, the attribute is only used if the position
argument is empty.openPopupAtScreen( x, y, isContextMenu )
showPopup( element, x, y, popupType, anchor, align )
Deprecated since Gecko 1.9-1
, the popup will be positioned relative to the element specified as the first argument. This is what you might do to show a popup below a button, for example. In this latter case, the anchor and align arguments may be used to further control where the popup appears relative to the element. The anchor argument corresponds to the popupanchor
attribute on the element. The align argument corresponds to the popupalign
attribute on the element. The anchor and align arguments are ignored if either x or y are not -1
.boxObject
.screenX and boxObject
.screenY properties of the element, and use those as the x and y arguments offset by the desired values.popup
, context
, or tooltip
. Each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently.sizeTo( width, height )
TBD