display the dom process by jquery
I'm trying to display the process 'slowly' by adding a setTimeOut()
for (i = 0; i < 10; i++){
setTimeout(function(){$("#result").prepend('dom<br/>')},2000);
}
Well, it doesn't work still, the dom process would display instantly after 2 second. What I want to do is 'see' the process of dom change, it would be like linux process file effect.
what should I do?
Answers 1
I would recommend separating functions and use setInterval
OR use 'for ~' for initializing the timing like below.