matchifang matchifang - 1 month ago 7
HTML Question

What is the DOM event when slider button stops moving

I want to make an ajax request whenever the slider button changes from moving to stopping, what is the event for that called?

Temporarily, I am using

oninput
event that calls
clipLimitChange(value)
to
console.log(value)
. I am looking for another event that will call
clipLimitChange()
only when the slider stops sliding, not while it is sliding.

Slider HTML code:

<input type="range" id="clipLimit" style="display: none;" value="2.0" min="0.1" max="5.0" step="0.1" oninput="clipLimitChange(value)">


The function should be called whenever user changes the slider and dropped it. Not while user is sliding it.

enter image description here

Answer

The onchange event will be triggered once the range stops moving.

<input type="range" id="clipLimit" style="display: none;" value="2.0" min="0.1" max="5.0" step="0.1" onchange="clipLimitChange(value)">
Comments