我的网站上有一个jquery UI滑块插件,它有10个点可供滑块移动。例如,用户可以将滑块从1移动到2,3或10等。我希望滑块在某一点禁用,例如,如果它在7号上,我想要停止滑块。其余点将正常。我怎样才能做到这一点?感谢
这是我用来显示滑块和数字的html
<div class="the_slider2">
<div id="slider2"></div>
</div>
<div class="slider2_bottom_txt">
<table >
<tbody>
<tr>
<td >1</td>
<td>2</td>
<td >3</td>
<td >4</td>
<td >5</td>
<td >6</td>
<td >7</td>
<td >8</td>
<td >9</td>
<td >10</td>
</tr>
</tbody>
</table>
</div>
这是我正在使用的jquery
var sliderAmountMap2 = [1,2,3,4,5,6,7,8,9,10];
$(function() {
$( "#slider2" ).slider({
value: 4, //array index of onload selected default value on slider, for example, 45000 in same array will be selected as default on load
min: 0, //the values will be from 0 to array length-1
max: sliderAmountMap2.length-1, //the max length, slider will snap until this point in equal width increments
});
});