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

Use numbers instead of percentages #1210

Closed khorammfar closed 2 years ago

khorammfar commented 2 years ago

I need to give the range of numbers to the slider myself instead of using %.

For example instead of writing this

range: {'min': 10, 'max': 2000, "2%": 200, "20%": 600}

use this:

{
  min: 100,
  max: 20000,
  range: [ [10, 1], [100, 10], [1000, 100] ]
}

For example, when the suffering number reaches 100, take ten to ten steps. When it reaches 1000, the steps will be 100 steps

Can such steps be specified?

leongersen commented 2 years ago

Yes, you can use steps like that. You'll just need to specify the percentages to position the starting locations for those steps on the slider.

Have a look at: https://refreshless.com/nouislider/slider-values/#section-non-linear-step

khorammfar commented 2 years ago

It does not work very interestingly on some sufferings Take a look at this link https://*.io/telegram-views/ I implemented the same with percentage ranges for every product are different

leongersen commented 2 years ago

I'm can't debug your site for you, if you have a specific problem, feel free to ask about it here.

github-actions[bot] commented 1 year 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.