Uma escala permite ao usuário selecionar um valor de uma faixa. Uma barra exibida horizontalmente ou verticalmente permite ao usuário selecionar um valor arrastando um ponteiro na barra.
Use o atributo de orientação para especificar a orientação da escala. O valor padrão é <tt>horizontal</tt>, que exibe uma escala horizontal. Valores pequenos são para a esquerda e valores maiores para a direita. Configure o atributo orient
para <tt>vertical</tt> para usar uma escala vertical.
O usuário pode usar as teclas de flecha para incrementar ou decrementar o valor em uma unidade, ou as teclas de "page up" e "page down" para incrementar ou decrementar uma página, como especificado pelo atributo pageincrement
. As teclas "home" e "end" configuram o valor da escala para os valores mínimo e máximo, respectivamente.
- Métodos
- decrease, decreasePage, increase, increasePage,
Examples
Escala horizontal:
<scale min="1" max="10"/>
Escala vertical:
<scale min="1" max="10" orient="vertical"/>
Atributos
-
disabled
- Type: boolean
-
Indicates whether the element is disabled or not. If this element is set to
true
the 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 thecommand
event will not fire. -
Visible controls have a
disabled
property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
-
min
- Type: integer
- The minimum value the control's value may take. The default value is 0.
- Type: integer
- The maximum value that the scale or number box may be set to. The default value is 100 for scales and Infinity for number boxes.
-
pageincrement
- Type: integer
- The amount by which the value of the
curpos
orvalue
attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down 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 highertabindex
are 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. Be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) Use another attribute like "value2" or "data-myAtt" (as in the HTML5 draft), as XUL does not require validation (less future-proof); 2) Use setAttributeNS() to put custom attributes in a non-XUL namespace (serializable and future-proof); 3) Use setUserData() (future-proof and clean, but not easily serializable). For user editable
menulist
elements, the contents, as visible to the user, are read and set using the Menulist.value syntax. For those elements, setAttribute("value", myValue) and getAttribute("value") do not access or affect the contents displayed to the user.
Propriedades
-
pageIncrement
- Type: integer
-
Gets and sets the value of the
pageincrement
attribute.
-
value
- Type: string
-
Gets and sets the value of the
value
attribute. Fortextbox
and user editablemenulist
elements, the contents, as visible to the user, are read and set using theTextbox.value
and Menulist.value syntax.
Métodos
-
decrease()
- Return type: no return value
-
Decreases the value of the scale or number box 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 or number box by the
increment
.
-
increasePage()
- Return type: no return value
- Increases the value of the scale by the page increment.
Relacionado
- Interfaces
- nsIDOMXULControlElement
Categorias
Interwiki Language Links