## Timer

Object Oriented Encapsulation of setTimeout

### Syntax

`new Timer([nPauseTime])`

### Parameters

Name | Type | Descripton
`nPauseTime` | `Number` | Optional. The time (in milliseconds) before the timer should be triggered once started. The default value is `1000`.

### Static Methods

Name | Description
None.

### Static Fields

Name | Type | Descripton
None.

### Methods

Name | Description
getPauseTime #### Syntax `object.getPauseTime()` #### Arguments No Arguments. #### Return Type `Number` | Returns the pause time (in milliseconds) used to wait once started before triggering the event
isStarted #### Syntax `object.isStarted()` #### Arguments No Arguments. #### Return Type `Boolean` | Returns whether the timer is started
setPauseTime #### Syntax `object.setPauseTime(nPauseTime)` #### Arguments
Name | Type | Descripton
`nPauseTime` | `Number` | The time to pause
#### Return Type `void` | Sets the time (in milliseconds) to pause before triggering the event
start #### Syntax `object.start()` #### Arguments No Arguments. #### Return Type `void` | Starts the timer
stop #### Syntax `object.stop()` #### Arguments No Arguments. #### Return Type `void` | Stops the timer if previously started

### Fields

Name | Type | Descripton
None.

### Events

Name | Descripton
`ontimer` | Fires nPauseTime milliseconds after started

### Remarks

None.

## Range

Used to model the data used when working with sliders, scrollbars and progress bars. Based on the ideas of the javax.swing.BoundedRangeModel interface defined by Sun for Java (http://java.sun.com/products/jfc/swingdoc-api-1.0.3/com/sun/java/swing/BoundedRangeModel.html).

### Syntax

`new Range()`

### Parameters

Name | Type | Descripton
No parameters.

### Static Methods

Name | Description
None.

### Static Fields

Name | Type | Descripton
None.

### Methods

Name | Description
getExtent #### Syntax `object.getExtent()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the extent of the range
getMaximum #### Syntax `object.getMaximum()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the maximum allowed value
getMinimum #### Syntax `object.getMinimum()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the minimum value
getValue #### Syntax `object.getValue()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the current value of the range
setExtent #### Syntax `object.setExtent(nExtent)` #### Arguments
Name | Type | Descripton
`nExtent` | `Number` | The extent of the value
#### Return Type `void` | Sets the extent of the range
setMaximum #### Syntax `object.setMaximum(nMaximum)` #### Arguments
Name | Type | Descripton
`nMaximum` | `Number` | The maximum value
#### Return Type `void` | Sets the maximum allowed value
setMinimum #### Syntax `object.setMinimum(nMinimum)` #### Arguments
Name | Type | Descripton
`nMinimum` | `Number` | The minimum value
#### Return Type `void` | Sets the minimum allowed value
setValue #### Syntax `object.setValue(nValue)` #### Arguments
Name | Type | Descripton
`nValue` | `Number` | The value for the range
#### Return Type `void` | Sets the value for the range

### Fields

Name | Type | Descripton
None.

### Events

Name | Descripton
`ontimer` | Fires on the object nPauseTime milliseconds after started

### Remarks

None.

## Slider

A slider control that allows the user to drag a handle to change the value that is limited by a maximum value and a minimum value.

### Syntax

`new Slider(oElement, oInput [, sOrientation])`

### Parameters

Name | Type | Descripton
`oElement` | `HTMLElement` | The element acting as a slider
`oInput` | `HTMLInputElement` | The input element used for backward compatibility and posting
`sOrientation` | `String` | Optional. The orientation of the slider. Valid values are "horizontal" and "vertical" The default value is `horizontal`.

### Static Methods

Name | Description
None.

### Static Fields

Name | Type | Descripton
`isSupported` | `Boolean` | Read only. This value is true if the browser supports dynamic sliders

### Methods

Name | Description
getBlockIncrement #### Syntax `object.getBlockIncrement()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the amount used for large increments
getMaximum #### Syntax `object.getMaximum()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the maximum value
getMinimum #### Syntax `object.getMinimum()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the minimum value
getOrientation #### Syntax `object.getOrientation()` #### Arguments
Name | Type | Descripton
#### Return Type `String` | Returns the orientation of the slider. Valid values are "horizontal" and "vertical".
getUnitIncrement #### Syntax `object.getUnitIncrement()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the amount used to do small increments
getValue #### Syntax `object.getValue()` #### Arguments
Name | Type | Descripton
#### Return Type `Number` | Returns the value of the slider
ontimer #### Syntax `object.ontimer()` #### Arguments
Name | Type | Descripton
#### Return Type `void` | Called when the timer used when holding down the mouse button is fired
recalculate #### Syntax `object.recalculate()` #### Arguments
Name | Type | Descripton
#### Return Type `void` | Recalculates the position and size of the sub elements to make ensure the layout is correct. Use this message after the slider has been resized.
setBlockIncrement #### Syntax `object.setBlockIncrement(nBlockIncrement)` #### Arguments
Name | Type | Descripton
`nBlockIncrement` | `Number` | The block increment value
#### Return Type `void` | Sets the amounf to increment the value for large increments. This value is used when using the page up and page down keys to change the value as well as when holding down the mouse on the slider (but not dragging the handle).
setMaximum #### Syntax `object.setMaximum(nMaximum)` #### Arguments
Name | Type | Descripton
`nMaximum` | `Number` | The maximum value
#### Return Type `void` | Sets the maximum allowed value for the slider
setMinimum #### Syntax `object.setMinimum(nMinimum)` #### Arguments
Name | Type | Descripton
`nMinimum` | `Number` | The minimum value
#### Return Type `void` | Sets the minimum allowed value for the slider
setOrientation #### Syntax `object.setOrientation(sOrientation)` #### Arguments
Name | Type | Descripton
`sOrientation` | `String` | The orientation to use
#### Return Type `EDIT_THIS` | Sets the orientation of the slider. Valid values are "horizontal" and "vertical".
setUnitIncrement #### Syntax `object.setUnitIncrement(nUnitIncrement)` #### Arguments
Name | Type | Descripton
`nUnitIncrement` | `Number` | The unit increment value
#### Return Type `void` | Sets the amount to increment the value for small increments. This value is used when using the arrow keys to change the value
setValue #### Syntax `object.setValue(nValue)` #### Arguments
Name | Type | Descripton
`nValue` | `Number` | The value to set
#### Return Type `void` | Sets the value of the slider

### Fields

Name | Type | Descripton
`classNameTag` | `String` | The extra string to add to the class name for a dynamic slider. This property is used to allow specific CSS rules to distinguish between static sliders and dynamic. This property should not be changed after any sliders have been created.

### Events

Name | Descripton
`onchange` | This event is fired when the value of the slider has changed

### Remarks

None.

Slider
Implementation
API
Demo
Download

Author: Erik Arvidsson