-2

i have 5 settimeouts. i want to clear the firstone when second one is called. and so on... help me guys???

4

3 回答 3

1

尝试类似:

var timeout1 = setTimeout(animate5, 1000);
var timeout2 = setTimeout(function() {
    clearTimeout(timeout1);
    animate4();
}, 11000);
...
于 2013-04-19T05:36:58.887 回答
0

尝试这个

 var timeout1 = setTimeout(animate5, 1000);
var timeout2 = setTimeout(function() {
    clearTimeout(timeout1);
    animate4();
}, 11000); 
于 2013-04-19T05:37:19.743 回答
0

尝试

var t5 = setTimeout(animate5, 1000);
var t4 = setTimeout(animate4, 11000);
var t3 = setTimeout(animate3, 21000);
var t2 = setTimeout(function() {
    clearTimeout(t1);
    animate2();
}, 31000);
var t1 = setTimeout(animate1, 41000);
于 2013-04-19T05:38:00.607 回答