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

jQuery EasyUI Form Plugin - Slider

jQuery EasyUI Form Plugin - Slider


jQuery EasyUI Plugins jQuery EasyUI Plugins


Override the default defaults via $.fn.slider.defaults.

The slider allows users to select a numeric value from a limited range. As the slider control moves along the track, a tooltip showing the current value is displayed; users can customize the slider by setting its properties.

Depends on

Usage

When used as a form field, create a slider from markup.





From the

It is also allowed to create a slider, but the 'value' property is invalid.



Create a slider.





$('#ss').slider({

    mode: 'v',

    tipFormatter: function(value){

        return value + '%';

    }

});

property

Name Type Description Default value
width number The width of the slider. auto
height number The height of the slider. auto
mode string Indicates the type of the slider. Possible values: 'h' (horizontal), 'v' (vertical). h
reversed boolean When set to true, the positions of the minimum and maximum values are swapped. Available since version 1.3.2. false
showTip boolean Defines whether to show the tooltip with value information. false
disabled boolean Defines whether to disable the slider. false
value number The default value. 0
min number The minimum allowed value. 0
max number The maximum allowed value. 100
step number The value to increase or decrease. 1
rule array Displays labels beside the slider; '|' denotes the value display line. []
tipFormatter function The function that formats the slider value. Returns the string value displayed in the tooltip.

Events

Name Parameters Description
onChange newValue,oldValue Triggered when the value of the text field changes.
onSlideStart value Triggered when dragging the slider starts.
onSlideEnd value Triggered when dragging the slider stops.
onComplete value Triggered when the slider value is changed by the user, whether by dragging the slider or by clicking it. Available since version 1.3.4.

Method

Name Parameters Description
options none Returns the slider options.
destroy none Destroys the slider object.
resize param Sets the slider size. The 'param' parameter contains the following properties:
 width:新的滑块宽度       

 height:新的滑块高度 |

| getValue | none | Gets the slider value.| onSelect | event | setValue | value | Sets the slider value.| onSelect | event | clear | none | Clears the slider value. Available since version 1.3.5.| onSelect | event | reset | none | Resets the slider value. Available since version 1.3.5.| onSelect | event | enable | none | Enables the slider component.| onSelect | event | disable | none | Disables the slider component. |


jQuery EasyUI Plugins jQuery EasyUI Plugins