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.64k stars 658 forks source link

Custom Formula With double slider #1178

Closed Hamzahsm closed 2 years ago

Hamzahsm commented 2 years ago

is there a way to do custom arithmetic on the "type : double" slider? I want to subtract the value in each circle and then multiply it by a certain number.

my page is here : https://mmovigi.com/nouislider-3/ or you can also click here

leongersen commented 2 years ago

Sure, all events have the numbers for the handles:

slider.noUiSlider.on('update', function(values, handle) {
    if (handle === 0) {
        // do something with values[handle]
    }
    if (handle === 1) {
        // do something else with values[handle]
    }
});
Hamzahsm commented 2 years ago

Hi, Thanks for your answer Leon!

i've been implemented on my site but it still didn't work.

I want the slider to be like this : https://boosting-ground.com/new-world/boosting/level-up

my code is goes like this.

code goes like this

your help will really help me in solving this problem

leongersen commented 2 years ago

Sorry, I can't help you in debugging your production code. Have a look at the contribution guidelines.

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.