O'Reilly logo

jQuery UI by Eric Sarrion

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The slider () Method

The slider () method can be used in two forms:

  • $(selector, context).slider (options)

  • $(selector, context).slider ("action", params)

The slider (options) Method

The slider (options) method declares that an HTML element should be managed as a slider. The options parameter is an object that specifies the appearance and behavior of the slider.

Some options allow you to position multiple cursors on the axis and specify whether the cursors can pass each other on the axis.

Managing the appearance and behavior of sliders

Table 7-1 describes the options for managing the appearance and behavior of sliders.

Table 7-1. Options for managing slider appearance and behavior

Option

Function

options.disabled

If true, disables the slider. No cursor movement or click on the axis will be considered until the slider is returned to the enabled state (by slider ("enable")).

options.animate

If true, creates an animated effect when users click directly on the axis. By default, it is set to false, in which case clicking on the axis places the cursor directly where the user clicked, with no animated effect.

options.orientation

Indicates the horizontal or vertical orientation of the slider. The default value is "horizontal". To position the slider vertically, use "vertical".

Managing the values of cursors

Table 7-2 describes the options available for managing the values that appear on the slider.

Table 7-2. Options for managing slider values

Option

Function

options.min

Indicates the value of the cursor when positioned ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required