Appendix S. Sliders

Method

Description

Return Value

Dialog Methods

slider(options)

Make the selected elements into slider elements (see "Slider Options").

jQuery

slider("moveTo", value, index)

Moves a slider's handle to the given position.

jQuery

slider("value", index)

Retrieves a handle's value.

jQuery

slider("disable")

Temporarily disables the slider.

jQuery

slider("enable")

Enables the slider.

jQuery

slider("destroy")

Completely removes the sliding functionality.

jQuery

Slider Options

Option

Description

Type

animate

Whether slide handles smoothly when the user clicks outside the handle on the bar. The default is false.

Boolean

axis

Normally you don't need to set this option because the plugin detects the slider orientation automatically. If the orientation is not correctly detected, you can set this option to 'horizontal' or 'vertical'.

horizontal or vertical

handle

The jQuery selector to use for the handle(s) of the slider. The default is ".ui-slider-handle".

Selector

handles

Specifies boundaries for one or more handles. Format: [{start:Integer, min:Integer, max:Integer, id:String} [, ..]]. Only start is required. If the slider doesn't have handles already, they are automatically created.

Object

max

The maximum value of the slider. Useful for tracking values via callback, and to set steps. The default is 100.

Integer

min

The minimum value of the slider. Useful for tracking values via callback, and to set steps. The default is 0.

Integer

range

If set to true, the slider will detect if you have two handles and create a stylable ...

Get Beginning JavaScript® and CSS Development with jQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.