Timer

Object Oriented Encapsulation of setTimeout

Syntax

new Timer([nPauseTime])

Parameters

NameTypeDescripton
nPauseTimeNumberOptional. The time (in milliseconds) before the timer should be triggered once started. The default value is 1000.

Static Methods

NameDescription
None.

Static Fields

NameTypeDescripton
None.

Methods

NameDescription
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

NameTypeDescripton
nPauseTimeNumberThe 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

NameTypeDescripton
None.

Events

NameDescripton
ontimerFires 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

NameTypeDescripton
No parameters.

Static Methods

NameDescription
None.

Static Fields

NameTypeDescripton
None.

Methods

NameDescription
getExtent

Syntax

object.getExtent()

Arguments

NameTypeDescripton

Return Type

Number

Returns the extent of the range
getMaximum

Syntax

object.getMaximum()

Arguments

NameTypeDescripton

Return Type

Number

Returns the maximum allowed value
getMinimum

Syntax

object.getMinimum()

Arguments

NameTypeDescripton

Return Type

Number

Returns the minimum value
getValue

Syntax

object.getValue()

Arguments

NameTypeDescripton

Return Type

Number

Returns the current value of the range
setExtent

Syntax

object.setExtent(nExtent)

Arguments

NameTypeDescripton
nExtentNumberThe extent of the value

Return Type

void

Sets the extent of the range
setMaximum

Syntax

object.setMaximum(nMaximum)

Arguments

NameTypeDescripton
nMaximumNumberThe maximum value

Return Type

void

Sets the maximum allowed value
setMinimum

Syntax

object.setMinimum(nMinimum)

Arguments

NameTypeDescripton
nMinimumNumberThe minimum value

Return Type

void

Sets the minimum allowed value
setValue

Syntax

object.setValue(nValue)

Arguments

NameTypeDescripton
nValueNumberThe value for the range

Return Type

void

Sets the value for the range

Fields

NameTypeDescripton
None.

Events

NameDescripton
ontimerFires 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

NameTypeDescripton
oElementHTMLElementThe element acting as a slider
oInputHTMLInputElementThe input element used for backward compatibility and posting
sOrientationStringOptional. The orientation of the slider. Valid values are "horizontal" and "vertical" The default value is horizontal.

Static Methods

NameDescription
None.

Static Fields

NameTypeDescripton
isSupportedBooleanRead only. This value is true if the browser supports dynamic sliders

Methods

NameDescription
getBlockIncrement

Syntax

object.getBlockIncrement()

Arguments

NameTypeDescripton

Return Type

Number

Returns the amount used for large increments
getMaximum

Syntax

object.getMaximum()

Arguments

NameTypeDescripton

Return Type

Number

Returns the maximum value
getMinimum

Syntax

object.getMinimum()

Arguments

NameTypeDescripton

Return Type

Number

Returns the minimum value
getOrientation

Syntax

object.getOrientation()

Arguments

NameTypeDescripton

Return Type

String

Returns the orientation of the slider. Valid values are "horizontal" and "vertical".
getUnitIncrement

Syntax

object.getUnitIncrement()

Arguments

NameTypeDescripton

Return Type

Number

Returns the amount used to do small increments
getValue

Syntax

object.getValue()

Arguments

NameTypeDescripton

Return Type

Number

Returns the value of the slider
ontimer

Syntax

object.ontimer()

Arguments

NameTypeDescripton

Return Type

void

Called when the timer used when holding down the mouse button is fired
recalculate

Syntax

object.recalculate()

Arguments

NameTypeDescripton

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

NameTypeDescripton
nBlockIncrementNumberThe 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

NameTypeDescripton
nMaximumNumberThe maximum value

Return Type

void

Sets the maximum allowed value for the slider
setMinimum

Syntax

object.setMinimum(nMinimum)

Arguments

NameTypeDescripton
nMinimumNumberThe minimum value

Return Type

void

Sets the minimum allowed value for the slider
setOrientation

Syntax

object.setOrientation(sOrientation)

Arguments

NameTypeDescripton
sOrientationStringThe 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

NameTypeDescripton
nUnitIncrementNumberThe 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

NameTypeDescripton
nValueNumberThe value to set

Return Type

void

Sets the value of the slider

Fields

NameTypeDescripton
classNameTagStringThe 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

NameDescripton
onchangeThis event is fired when the value of the slider has changed

Remarks

None.

Slider
Implementation
API
Demo
Download

Author: Erik Arvidsson