I have the following:
$('body, a').addClass('cursor-wait'); for (var I=0, L = myArray.length; I < L; I++) { // tight loop here } $('body, a').removeClass('cursor-wait');
But I'm not sure what the cursor is: the wait icon appears immediately.
Q: Is there a way to say โDoEventsโ in JavaScript so that I know that the DOM is updated before it goes into a loop?
It is possible to use the setTimeout method.
Phillip senn
source share