Home>

got the requirement to create a range selection slider (integers 10-25), without resorting to jQuery and third-party libraries. Only clean JS! .. Well, hardcore a little. The question is -what is better -resort to the option of creating two connected input [type= Range] or study and do with the help of Drag'n'Drop technology? And then the question is more regarding the first option, because It seems to me that the second is much personally visible:

How to prohibit one of the sliders move towards another after a meeting with the second at the point?

"Do not resort to jQuery" -means at all without ready-made solutions or only without jQuery?

MedvedevDev2021-05-06 07:37:28

@Medvedevdev, and without ready-made solutions too

mayst2021-05-06 07:37:28

In fact, I personally can not come up with how you plan to associate 2 Renzh input, I would rather on the contrary because of more obviousness chose the option with d'n'd. As for the question of how to "prohibit go further", then the question is also interesting, since CHANGE works only when the slider is released, that is, hang on it if (Range.Value>Anotherrange.Value) Range.Value= Anotherrange.Value; -It will not work (it will work, but quite ugly), that is, you still need to track the movement of the mouse ....

MedvedevDev2021-05-06 07:37:28

@MedvedevDev, I simply seems easier and obvious just the same option with binding, since with D'N'D it did not work. In fact, when you change each moment, the "STEP" changes the Value slider. Everything that comes to mind is to compare each time the value of the VALUE of one slider, the values ​​of both. And cross the values ​​of the variables from and to, respectively, in case of need

mayst2021-05-06 07:37:28

@MedvedevDev, the point is that I plan not to return it back to fifteen, but to reach up to 25 and leave there. And Batz, now this slider shows not "from", but "before" .. this will give the user the right to move to the left-right without joints with the second slider, like a bug, and the feature. And in the same case, a post-freight is clearly divided by the sliders on the front and rear, because Both can act as both

mayst2021-05-06 07:37:28