Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery UI API - Slider Widget

jQuery UI API - Slider Widget

Category

Widgets

Usage

**Description:** Drag a handle to select a numeric value.

**Version added:** 1.5

The jQuery UI Slider plugin allows selection via a slider. There are various options, such as multiple handles and ranges. Handles can be moved with the mouse or arrow keys.

The Slider Widget creates handle elements with the ui-slider-handle class at initialization. You can specify custom handle elements by creating and appending elements before initialization and adding the ui-slider-handle class to them. It only creates as many handles as are needed to match the value/values length. For example, if you specify values: [ 1, 5, 18 ]and create one custom handle, the plugin will create the other two.

Theming

The Slider Widget uses jQuery UI CSS Framework to define the style of its look and feel. To use slider-specific styling, you can use the following CSS class names:

- `ui-slider-handle`: The slider handle. - `ui-slider-range`: The selected range used when the [`range`](#option-range) option is set. If the `range` option is set to `"min"` or `"max"`, this element additionally has a `ui-slider-range-min` or `ui-slider-range-max` class, respectively.

Depends on

Additional Notes

Example

A simple jQuery UI slider.









  

  滑块部件(Slider Widget)演示