我想使用JavaScript控制jquery UI滑块。当事件被触发时,我想将滑块移动到某个位置。
$('select#dn_event_date, select#up_event_date').selectToUISlider(
{
// labels and tooltipSrc are selectToUISlider specific options
labels: 0
sliderOptions: {
// swapped out stop for change here
change: function(){
// Here i want to control to move slider to certain position
}
}
}
);我该怎么做呢?
发布于 2013-03-05 20:36:28
您只需要使用value()函数
例如,假设你有一个按钮,当用户点击它时,你需要将滑块从开始位置移动大约60%:
$('#btnRun').click(function(){
$(".selector").slider("value",60);
});有关更多信息,请查看this。
https://stackoverflow.com/questions/15223652
复制相似问题