slider Behavior

This topic documents a feature of Binary Behaviors, which are obsolete as of Internet Explorer 10.

Adds a slider control to the document.



CustomTag ID=sID STYLE="behavior:url('')" />

HTML <ELEMENT STYLE="behavior:url('')" ID=sID>
Scripting = "url('')"
object.addBehavior ("")

Possible Values

Prefix Prefix that associates the CustomTag with an XML namespace. This prefix is set using the XMLNS attribute of the HTML tag.
CustomTag User-defined tag.
sID String that specifies a unique identifier for the object.

Members Table

The following table lists the members exposed by the slider object.

Attribute Property Description
DYNAMIC dynamic Specifies whether the onchange event continually fires while the slider is in motion.
MAX max Sets or retrieves the highest value on a continuous range of possible values for the slider behavior.
MIN min Sets or retrieves the lowest value on a continuous range of possible values for the slider behavior.
sl--bar-color slBarColor Sets or retrieves the background color of the slider bar.
sl--orientation slOrientation Sets or retrieves whether the slider bar for the slider behavior will render horizontally or vertically.
sl--snap slSnap Specifies whether the slider is automatically positioned over the nearest tick mark when the mouse button is released.
sl--tick-color slTickColor Sets or retrieves the color of the ticks for the slider behavior.
sl--tick-style slTickStyle Sets or retrieves the location of the ticks for the slider behavior.
TICKINTERVAL tickInterval Sets or retrieves the number of ticks representing one unit of value for the slider behavior.
TICKNUMBER tickNumber Sets or retrieves the total number of ticks on the slider behavior.
Event Property Description
onchange Fires when the value of the slider behavior changes.
onerror Fires when an incorrect value is set for the slider behavior changes.


The behavior-defined members listed in the preceding table are not accessible through script until the window. onload event fires. Waiting for this event to fire ensures that the document is completely loaded, that all behaviors have been applied to corresponding elements on the document, and, consequently, that all the behavior's properties, methods, and events are available for scripting. Attempting to use any of the behavior-defined members will result in a scripting error indicating that the object does not support that particular member.

The slider behavior inserts a slider control into a document and is a method for authors to allow users to select a value from a gradient. A slider can be placed on the document with a vertical or horizontal orientation. Values are selected by dragging the slider. Tick marks are provided according to an author-specified range.

When the slider behavior is included in a form, a name/value pair is submitted.

The file can be downloaded from the slider  sample page.

In addition to the members and styles previously listed, the slider behavior supports:


This sample demonstrates the implementation and adjustments of the slider behavior.

@media All{
      behavior: url(
style="POSITION: absolute"

Code example:

See Also

Introduction to DHTML Behaviors, Using DHTML Behaviors