This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Repository navigation
Custom step size averaged out across the slider? #359
|
Hey man, love your slider it's gorgeous. I have a range from 0 - 400. I need five steps in that range - 1.5, 2, 6, 10, and 100. The problem is that they're all mostly clustered down at the end of the slider, because there are so many low numbers. Is there a way to add custom steps wherever I like along the slider, so instead of looking like this: 0----------100---------200---------300---------400 It would look like: 0----1.5------2--------6-------10------100-----400 Is that doable? |
Answered by
andreruffert
Feb 16, 2021
Replies: 1 comment 6 replies
|
Have a look at this codepen. <input type="range" min="0" max="6" step="1" value="0">const valueMapping = [0, 1.5, 2, 6, 10, 100, 400] |
6 replies
Answer selected by
andreruffert
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have a look at this codepen.
It describes an approach of value mapping. In your case this would look something like this: