leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.69k stars 657 forks source link

Min value in range #119

Closed bigbadmytyx closed 11 years ago

bigbadmytyx commented 11 years ago

Hi, thanks for this great plugin. I have a question, is there any way to set minimal value in range? I have range from 0 to 5, and I need a handle to stop moving left on 1.

leongersen commented 11 years ago

This isn't an option in the slider, but you can easily do this.

Assuming the default theme, use the following CSS:

    .noUi-target {
        padding-left: 20%;
        background: #DDD;
        border: 1px solid #BFBFBF;
    }
    .noUi-base {
        border: 0;
        height: 38px;
    }

With these options:

    $('#slider').noUiSlider({
         range: [1,5]
        ,start: [1,5]
        ,step: 1
    });

Let me know if you need more help!

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.