I\'m testing the slider events in jQueryMobile and I must been missing something.
page code is:
Based on @VTWood's solution; here's a generic 'fix' for all jQuery-Mobile 1.1 sliders so they dispatch start and stop events at the appropriate times. You just need to drop this code into your page once to patch up all future sliders.
$(document).on({
"mousedown touchstart": function () {
$(this).siblings("input").trigger("start");
},
"mouseup touchend": function () {
$(this).siblings("input").trigger("stop");
}
}, ".ui-slider");
In a nutshell, it binds an event listener to the document object which listens for both mousedown and touchstart events triggered from .ui-slider elements. Once triggered the handler function will find the input element which sits alongside the .ui-slider control that was clicked and trigger a start event. You can consume this like so:
$("#my-slider").on("start", function () {
console.log("User has started sliding my-slider!");
});
$("#my-slider").on("stop", function (event) {
var value = event.target.value;
console.log("User has finished sliding my slider, its value is: " + value);
});