Jquery UI slider min / max values

Guys, I have one simple question. Can I put min / max text values ​​for the jquery ui slider and when scrolling to display numbers? An example is shown here, the left slider for the maximum value has "no limits", and when scrolling - numbers.
+5
source share
3 answers

You are looking for a range slider. I hope the slide range slider helps. Minimum and maximum values ​​can be set during slider initialization.

Edited Sorry for not understanding the question. If you look at the demo source code , you will see a small script that changes the values ​​of the '#amount' element when the values ​​of the slider are changed

Here is the script:

slide: function( event, ui ) {
            $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
        }

You can change this to display character values.

slide: function( event, ui ) {
            if (ui.values[0] == <min_value>) {
                 $( "#amount" ).val( "Min Limit" + " - $" + ui.values[ 1 ] );
            }
        }

You can modify this script to suit your requirements.

Note: I have not tested this.

+2
source

Yes we can set min-max

$("#slider").slider({
    range: "max",
    min: 0, // min value
    max: 200, // max value
    step: 0.1,
    value: 200, // default value of slider
    slide: function(event, ui) {
        $("#amount").val(ui.value);
    }
});​
+5
source

, . .

$("#selector").slider("destroy");

,

$("#selector").slider({
range: "max",
min: 0, // min value
max: 200, // max value
step: 0.1,
value: 200, // default value of slider
slide: function(event, ui) {
    $("#amount").val(ui.value);
}

});

.

0
source

All Articles