The code, unfortunately, I can not attach.
There is an implementation of the slider, which moves when a person's age changes. The length of the block that the 166px slider moves. The minimum age is 16 years, the maximum is 80. That is =>
0px = 16 лет 166px = 80 лет I had a problem with drawing up a formula that will calculate age, depending on the location of the slider, for example,
33 px = x лет Tell me where to go to make the right formula?
I tried this:
80 лет = 166px x лет = 33px => x = (80 * 33) / 166 As a result, this is almost the right decision, but there is a minus, 1px != 16
длина_ползунка / (max_лет - min_лет).... but there you will have to indulge with rounding ..... in the end, 0px - 16 years, 2,6px - 17 years, 5,2px - 18 years, etc. ..... okrulenie will need to be because no decimal - Alexey Shimansky<input type="range", set a minimum, maximum, step. and just stylize it) - Alexey Shimanskyrangedoes not work here, since two sliders are used, between which the age gap is Amandi<input type="range" min="16" max="80" step="4"/>. Everything .... further, at theonchangeevent, theonchangesimply recalculated ..... maybe I don’t quite understand what theиспользуются два ползунка, между которыми промежуток возраста. But while I do not see any problems with this. I see the opposite, only pluses)) codepen.io/gearmobile/pen/beVNqj ..... especially the slider can be put in through css length 166px and not sweating .... - Alexey Shimansky