XUL:scale
From MDC
This article covers features introduced in Firefox 3
« XUL Reference home [ Examples | Attributes | Properties | Methods | Related ]
A scale (sometimes referred to as a "slider") allows the user to select a value from a range. A bar displayed either horizontally or vertically allows the user to select a value by dragging a thumb on the bar.
Use the orient attribute to specify the orientation of the scale. The default value is horizontal which displays a horizontal scale. Lower values are to the left and higher values are to the right. Set the orient attribute to vertical to use a vertical scale.
The user may use the arrow keys to increment and decrement the value by one unit, or the page up and page down keys to increment and decrement the value by one page, as specified by the pageincrement attribute. The home and end keys set the scale's value to the minimum and maximum values, respectively. A scale will fire a change event whenever the scale's value is modified.
- Methods
- decrease, decreasePage, increase, increasePage,
[edit] Examples
Horizontal Scale:
<scale min="1" max="10"/>
Vertical Scale:
<scale min="1" max="10" orient="vertical"/>
[edit] Attributes
|
Inherited from XUL element |
- dir
- Type: one of the values below
- The direction in which the child elements of the element are placed.
-
normal: The scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) -
reverse: The scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales).
- disabled
- Type: boolean
- Indicates whether the element is disabled or not. If this element is set to
truethe element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and thecommandevent will not fire.
- increment
- Type: integer
- The amount by which the curpos (for scroll bars) or value (for number boxes) attribute changes by when the arrows are clicked. The default value is 1.
- min
- Type: integer
- The minimum value that the scale may be set to. The default value is 0.
- max
- Type: integer
- The maximum value that the scale may be set to. The default value is 100.
- pageincrement
- Type: integer
- The amount by which the value of the value attribute changes by when the PgUp or PdDn keys are pressed. The default value is 10.
- tabindex
- Type: integer
- The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher
tabindexare later in the tab sequence.
- value
- Type: string
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.
[edit] Properties
|
Inherited from XUL element Inherited from DOM element |
- pageIncrement
- Type: integer
- Gets and sets the value of the pageincrement attribute.
[edit] Methods
|
Inherited from XUL element Inherited from DOM element |
- decrease()
- Return type: no return value
- Decreases the value of the scale by the increment.
- decreasePage()
- Return type: no return value
- Decreases the value of the scale by the pageincrement.
- increase()
- Return type: no return value
- Increases the value of the scale by the increment.
- increasePage()
- Return type: no return value
- Increases the value of the scale by the page increment.
[edit] Related
- Interfaces
- nsIDOMXULControlElement