简体   繁体   中英

jQuery Slider Min Value

I know there is a min value in jquery's slider. However, is there a way I can make the slider handle stop moving under some value? Is there any variable I can change to make this happen?

Note: My Slider is vertical
Basically, if the minimum is 20, I don't want the slider handle going under 20.

Well you can check it in slide functionality as below:

DEMO HERE

$(function() {
      $( "#slider-range" ).slider({
            orientation: "vertical",
            range: false,
            value:20,
            slide: function( event, ui ) {
                 if (ui.value < 20)  // corrected
                    return false;
                else
                    $( "#amount" ).val( ui.value );

            }
      });
    $( "#amount" ).val( $( "#slider-range" ).slider( "value" ) );
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM