我希望在选中单选按钮之前禁用jQuery UI滑块的功能。非常直接,但我没有运气,我尝试过的东西,所以我希望得到一些帮助。为方便起见:http://jsfiddle.net/nlem33/L5cY6/11/
$('#slider1').slider({
min: min_value,
max: max_value,
step: 1,
slide: sliderHandler,
stop: function (event, ui) {
}
});
var min_value = 0;
var max_value = 630;
$('#slider2').slider({
min: min_value,
max: max_value,
step: 5,
slide: sliderHandler,
stop: function (event, ui) {
}
});
答案 0 :(得分:0)
您可以将它们初始化为禁用,然后在单击单选按钮时启用它们:
$('#slider1').slider({
min: min_value,
max: max_value,
step: 1,
disabled: true, // <= disabled on init
slide: sliderHandler,
stop: function (event, ui) {
}
});
// Enable function :
$(':radio').click(function() {
$('#slider1, #slider2').slider('enable');
});