Search within TutorialsPark

jQuery UI : Slider Methods


Learn how to use jQuery UI Slider Method


jQuery UI : Slider Methods

The jQuery UI slider methods are used to control various slider options.It is same as the basic set of methods for other jQuery UI widgets.

There are two new slider method which lets you set either a single value or the range of values to be displayed.

Table : jQuery UI Slider Methods

Settings Description
slider("destroy") To destroy the slider and return the element to its original state.
slider("disable") To disable the slider.
slider("enable") To enable the slider
slider("option") To set one or more than one option.
slider("value" , value) To get or set the value of a regular slider.
slider("values", [values]) It get or set the values of a range slider.


jQuery UI : Controlling Sliders using a Program

In the demo below, we have two sliders with there input elements to set the value of the slider handles, without moving the handles.

We select input elements and then use change method to reflect changes when ever the value of input element is changed.

The position of the handles is changed using the values and value method based on the result of switch method which uses id Attribute.

Example: jQuery UI - Controlling sliders using a Program

Give it a TRY! » Note: Moving the handles do not reflect a change in value in the input element.