I am using a jQuery plugin to create sliders with ticks, labels and tooltips. I am in need of a way to be able to disable/enable it like a textbox or combobox. For e.g. When user land on the page the slider appears disabled but when user changes a dropbox or slide another slider this should get enabled. I couldn’t find any documentation on this particular functionality. Need help.
//SLIDER 1
$('select#milestones').selectToUISlider({
labels:4,
tooltip: false,
labelSrc: 'text',
sliderOptions:{
change: function(e, ui) {
filterAndLoadChart((parseInt(ui.value)) + 1);
if(ui.value > 0){
//I WANT TO ENABLE THE SLIDER 2 HERE
}
}
}
});
//SLIDER 2
$('select#age').selectToUISlider({
tooltip: false,
labelSrc: 'value',
sliderOptions:{
disabled:true,
change:function(e, ui) {
var selVal = $('#age').val();
$("#ageTxt").html(selVal + " Days");
}
}
});
selectToUISlider create slider with class ui-slider
so you can disable/enable it with standart jquery-ui slider method:
$('.ui-slider').slider('disable');$('.ui-slider').slider('enable');