I have a slider that allow the use to choose two values by dragging the slider.
I've added an onmouseup event to the div so that when the user finishes dragging, a function is called.
i.e.
<div id="slider" onmouseup="myFunction()">
Some code
</div>
This works well in most instances. But if the user starts dragging and their mouse happens to be outside of the div when they finish (fairly common), the onmouseup event is not triggered.
Is there another event that would suit my needs?
I've tried using two events:
<div id="slider" onmouseup="myFunction()" onmouseout="myFunction()">
Some code
</div>
But the events don't work together so the values gathered by the function flicker between the user specified values and the default (since they're called at different times).
I pretty much want onMouseUp to work if the click starts in the div but it can come 'up' anywhere. Any ideas?