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
Post a Comment