How to Slow down For-loop in Jquery? -


i want perform 100 actions loop. working fast , want slow down process, need 1 second difference between each of process. following code on working.

for(var i=1;i<=100;i++)     {         $("#span"+i).html("success");     } 

please on this.

thank you.

here's on way can using settimeout

function success(i) {   if (i > 100) return;    $("#span" + i).html("success");    settimeout(function() {     success(i+1);   }, 1000); }  success(1); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -