-1
我想在運行該函數時更改setTimeout速度。setTimeout更改運行速度
我想即時通訊幾乎在那裏,還有一些東西在我的腳本上還沒有工作。但我無法弄清楚什麼。
有人可以幫助我嗎?
$('input[type="range"]').rangeslider({
polyfill: false,
onInit: function() {
this.update();
},
onSlide: function(pos, value) {
tempPosition = pos + this.grabX;
position = (tempPosition <= this.handleWidth) ? this.handleWidth : (tempPosition >= this.maxHandleX) ? this.maxHandleX : tempPosition;
//timer = setTimeout(counter, value);
//clearTimeout(timer);
//var speed = value;
//clearTimeout(timer);
var timer = 0;
timer.length = 0;
timer = setTimeout(counter, value);
clearTimeout(timer);
document.getElementById("demo").innerHTML = timer;
//alert(counter);
}
});
var counter = function() {
imagesArray[i].setOpacity(0.00);
i++;
if(i > 23){
i = imagesArray.length - 23;
}
imagesArray[i].setOpacity(0.60);
speed = parseInt(speed);
setTimeout(counter, speed);
document.getElementById("test").innerHTML = speed;
};
counter();
感謝這對我工作! – user3408380 2015-02-09 23:48:47