+ 1
What is clearInterval and how to use it??
5 Respuestas
+ 8
setTimeout(callback,delay,funcparam1,funcparam2,…);
function callback(funcparam1,funcparam2,…){}
(you can even pass parameters)
+ 7
Also learn about "setTimeout"……
+ 5
var x = setInterval(function() {alert("Hello")}, 1000) ;
clearInterval(x)
+ 2
- clearInterval(timer) cancel a timer=setInterval(func,delay) running;
- timer=setTimeout(func,delay) is cancelable by clearTimeout(timer)
The two kinds are for delaying the execution of the function passed in arguments, one occurs every 'delay', the other occurs only once ^^
+ 1
thanks to all.