jQuery Mobile Form Slider
jQuery Mobile Slider Control
A slider allows you to select a value from a range of numbers:
To create a slider, use the :
Example
Try it »
Use the following attributes to specify limits:
- max - specifies the maximum allowed value
- min - specifies the minimum allowed value
- step - specifies the legal number intervals
- value - specifies the default value
Tip: If you want to display the progress value in the button, you can add the data-show-value="true" attribute:
Example
data-show-value="true"
Try it »
Tip: If you want to show the progress on the sliding button (like a small popup), you can use the data-popup-enabled="true" attribute:
Example
data-popup-enabled="true"
Try it »
**Tip:** If you want to highlight the slider's value, add data-highlight="true":
Example
data-highlight="true"
Try it »
Flip switch
A flip switch is typically used for on/off or true/false buttons:
We can use the element and specify data-role as "flipswitch" to create a switch:
Example
Try it »
By default, the switch text is "On" and "Off". You can change it using the data-on-text and data-off-text attributes:
Example
data-on-text="True" data-off-text="False"
Try it »
**Tip:** The switch checkbox can use the "checked" attribute to set the default option:
Example
checked
Try it »
More examples
Range slider
Make a slider for a range of values.
Slider styles
Set styles for the slider switch.