jquery-ui .slider方法未定义 10
//加载slider$(function(){$("#slider").slider({range:"max",min:0,max:23,value:t,create:f...
//加载slider
$(function () {
$("#slider").slider({
range: "max",
min: 0,
max: 23,
value: t,
create: function (event, ui) {
at(t);
},
stop: function (event, ui) {
var time = ui.value;
at(time);
}
});
});
//播放
function play() {
alert(1);
var timesRun= 0;
interval = setInterval(function () {
$("#slider").slider({
range: "max",
min: 0,
max: 23,
value: timesRun,
change: function (event, ui) {
at(timesRun);
}
});
timesRun += 1;
t=timesRun;
if (timesRun == 23) {
clearInterval(interval);
}
}, 1000);
}
slider加载时没有问题,但是当触发播放事件执行play()方法时里面的$("#slider").slider()会报错 :.slider未定义 展开
$(function () {
$("#slider").slider({
range: "max",
min: 0,
max: 23,
value: t,
create: function (event, ui) {
at(t);
},
stop: function (event, ui) {
var time = ui.value;
at(time);
}
});
});
//播放
function play() {
alert(1);
var timesRun= 0;
interval = setInterval(function () {
$("#slider").slider({
range: "max",
min: 0,
max: 23,
value: timesRun,
change: function (event, ui) {
at(timesRun);
}
});
timesRun += 1;
t=timesRun;
if (timesRun == 23) {
clearInterval(interval);
}
}, 1000);
}
slider加载时没有问题,但是当触发播放事件执行play()方法时里面的$("#slider").slider()会报错 :.slider未定义 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询