I have a specific margin or distance that needs to be changed from an HTML select option tag dynamically in the future. I have implemented a Range Slider using jQueryUI Slider.
My objective: I am looking to halt the sliding action once a specific distance, or margin, is reached. Any assistance would be greatly appreciated.
JSFIDDLE: http://jsfiddle.net/3j3Um/1/
HTML
<div id="slider-range"></div>
jQuery
$("#slider-range").slider({
range: true,
min: 0,
max: 95,
values: [20, 80],
slide: function (event, ui) {
var getMargin = ui.values[0] - ui.values[1];
$("#margin").val(getMargin);
if (getMargin == -30) {
alert('stop the sliding');
}
}
});