我正在使用jQuery滑块UI作为音频播放器中的滑块,只有滑动功能在我设置变量时才起作用.
$('.body_container .slider').slider({
value: 0,
step: 0.01,
orientation: "horizontal",
range: "min",
max: song.duration,
animate: true,
slide: function(event,ui) {
manualSeek = true;
},
stop:function(event,ui) {
manualSeek = false;
song.currentTime = ui.value;
}
});
Run Code Online (Sandbox Code Playgroud)
在firebug中它出现了错误closestHandle is undefined.closestHandle来自jQuery UI文件.
但是当我在函数中没有设置任何选项并且只是保留事件时它确实有效,但显然我需要设置选项;
$('.body_container .slider').slider({
slide: function(event,ui) {
manualSeek = true;
},
stop:function(event,ui) {
manualSeek = false;
song.currentTime = ui.value;
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3947 次 |
| 最近记录: |