I would run a function when I stop to slide the Jquery Mobile Slide.
I have this slide:
<div data-role="fieldcontain">
<fieldset data-role="controlgroup" data-mini="true">
<label for="slider2">
Test
</label>
<input type="range" name="slider" id="testslider" value="0" min="-50" max="50" data-highlight="true" />
</fieldset>
</div>
And This Javascript:
$(function() {
$( "#slider2" ).bind( "stop", function(event, ui) {
alert("Stop");
});
});
But It don't work!
How I can run a function when I release the mouse (finger)??
The right method is the following:
$("#slider2").on(
'slidestop',
function(event) {
// Code goes here
}
);
来源:https://stackoverflow.com/questions/10898958/jquery-mobile-slide-stop-function