diff --git a/js/selectToUISlider.jQuery.js b/js/selectToUISlider.jQuery.js index 18704d7..33793da 100755 --- a/js/selectToUISlider.jQuery.js +++ b/js/selectToUISlider.jQuery.js @@ -24,6 +24,7 @@ jQuery.fn.selectToUISlider = function(settings){ tooltip: true, //show tooltips, boolean tooltipSrc: 'text',//accepts 'value' as well labelSrc: 'value',//accepts 'value' as well , + minRange: 0,//minimal range between handles sliderOptions: null }, settings); @@ -84,6 +85,15 @@ jQuery.fn.selectToUISlider = function(settings){ range: selects.length > 1,//multiple select elements = true slide: function(e, ui) {//slide function var thisHandle = jQuery(ui.handle); + + // If multiple select is true this checks minimal + // range between handles + if (sliderOptions.range) { + if ((ui.values[1] - ui.values[0]) <= options.minRange - 1) { + return false; + }; + }; + //handle feedback var textval = ttText(ui.value); thisHandle