A slider element can have its value set on initialization by providing a value
option. This option is a number:
$( "#slider" ).slider({
value: 5
});
A range slider can also have its values set in this way by providing a values
option. This option is an array of numbers:
$( "#range-slider" ).slider({
range: true,
values: [5, 25]
});
In addition to providing initial values, the minimum value, maximum value, and handle interval can be defined with the min
, max
, and step
options, respectively:
$( "#range-slider" ).slider({
range: true,
min: 0, // The lowest possible value will be 0
max: 100, // The highest possible value will be 100
step: 5, // The slider handles will lock in at intervals of 5
values: [0, 100]
});