I\'m trying to find a way to disable the click on my jQuery UI Slider\'s track. Clicking on the handle is ok but I do not want the handle to respond if the user clicks on t
Having spent a while looking for a solution or something that would help get me closer to what I was after, I came up with the following, which appears to work in all browsers:
var _sliderEvents = [];
$('.slider').each(function (i) {
var _slider = $(this);
_sliderEvents.push($._data(_slider[0]).events.mousedown);
$._data(_slider[0]).events.mousedown = {};
_slider.on({
mouseenter: function () {
$._data(_slider[0]).events.mousedown = _sliderEvents[i];
},
mouseleave: function () {
$._data(_slider[0]).events.mousedown = {};
}
}, '.ui-slider-handle');
});
http://jsfiddle.net/digits/fxef8398/ You're welcome :)