XUL Programmer's Reference Manual

<scrollbar>

Attributes Common Children
id <scrollbarbutton />
class <slider>
curpos  
maxpos  
pageIncrement  
increment  
flex  
align  
orient  
autostretch  
<scrollbar> is the XUL scrollbar widget. Scrollbar is a container for the three main visible elements of the scrollbar, the scrollbarbutton, the slider, and the thumb (which is actually a child of slider). The scrollbar's attributes specify the positioning of the elements within the scrollbar (curpos) and the degree of scrolling (pageIncrement). The following example shows a simple scrollbar:
 
<scrollbar orient="vertical" 
    curpos="50" 
    pageIncrement="20" 
    increment="5" 
    flex="100%">
  <scrollbarbutton type="decrement"/>
  <slider flex="100%">
     <thumb value="Thumb" flex="0%"/>
  </slider>
  <scrollbarbutton type="increment"/>
</scrollbar>


 

curpos
Description
curposis an optional attribute that specifies the position of the thumb in the slider when the scrollbar is initially displayed. 
Syntax
<scrollbar curpos="number of pixels from left/top in orientation


Example

<scrollbar orient="vertical" 
    curpos="50" 
Notes
If the orientation of the scrollbar is vertical, then the counting starts from the top. If horizontal, from the left. Curpos
 
 
maxpos
Description
maxposis an optional attribute that specifies the size of the scrollbar's slider. When not given, the slider stretches to take up the available space. 
Syntax
<scrollbar max="length of slider in pixels" >


Example

<scrollbar orient="vertical" 
    maxpos="250"
    curpos = "125" >

 
Notes
curpos and maxpos work together to define the length of the slider and where on the slider the thumb initializes.
 
pageIncrement
Description
pageIncrement is an  optional attribute that specifies how far the scrollbar scrolls when given a pagedown command. 
Syntax
<scrollbar id="string" pageIncrement="number of pixels to scroll down" />


Example

<scrollbar id="string" pageIncrement="25" />


Notes

The pagedown command is passed when a user clicks in the slider, but not on the thumb element itself. A regular increment is done when the user clicks on the scrollbar arrows.

 

 

increment
Description
Increment is an optional attribute that specifies how far the page moves when the arrows on the slider are clicked. 
Syntax
<scrollbar id="string" Increment="number of pixels" />


Example

<scrollbar id="string" Increment="10" />


Notes

None.
 
Last updated: 2/17/00 Ian Oeschger