我正在使用 jquery - Filamentgroup 滑块。我想限制滑块的移动。
Javascript
$('select#valueA, select#valueB').selectToUISlider({
sliderOptions: {
change:function(e, ui) {
return false;
}
},
labels: 12
});
HTML
<fieldset>
<label for="valueA">From:</label>
<select name="valueA" id="valueA">
<option value="6am">6:00</option>
<option value="7am">7:00</option>
<option value="8am">8:00</option>
<option value="9am" selected="selected">9:00</option>
<option value="10am">10:00</option>
<option value="11am">11:00</option>
<option value="Noon">Noon</option>
<option value="1pm">1:00</option>
<option value="2pm">2:00</option>
<option value="3pm">3:00</option>
<option value="4pm">4:00</option>
<option value="5pm">5:00</option>
<option value="6pm">6:00</option>
<option value="7pm">7:00</option>
<option value="8pm">8:00</option>
<option value="9pm">9:00</option>
<option value="10pm">10:00</option>
<option value="11pm">11:00</option>
<option value="12pm">12:00</option>
</select>
<label for="valueB">To:</label>
<select name="valueB" id="valueB">
<option value="6am">6:00</option>
<option value="7am">7:00</option>
<option value="8am">8:00</option>
<option value="9am">9:00</option>
<option value="10am">10:00</option>
<option value="11am">11:00</option>
<option value="Noon">Noon</option>
<option value="1pm">1:00</option>
<option value="2pm">2:00</option>
<option value="3pm">3:00</option>
<option value="4pm">4:00</option>
<option value="5pm">5:00</option>
<option value="6pm">6:00</option>
<option value="7pm">7:00</option>
<option value="8pm">8:00</option>
<option value="9pm" selected="selected">9:00</option>
<option value="10pm">10:00</option>
<option value="11pm">11:00</option>
<option value="12pm">12:00</option>
</select>
</fieldset>
我如何控制滑块的移动。这意味着如果有人将滑块移动到某个位置,我需要务实地将滑块移动到特定位置。
我怎样才能做到这一点?