I’m creating a web page that allows users to select a value using the jQuery UI Slider. However, I would like to update the values as the user is scrolling, so I attached a update_value function to the sliders slide event.
The issue is that when the slider handle gets to the edges, the value I get is incorrect. For example, I get a value of 500 when it should be 0, and 99000 when it should be max. (100000).
I tried testing with the change event, and it gives me the exact value required. However, the problem is still there when I try using the slide event.
Any ideas?
Solved it! The problem is that using:
$('slider').value()Doesn’t give the exact value for some reason. However, by modifying the update_value function to:
function update_value(event, ui)and using ui.value solved the problem.