OK, OK, I know - I'm having a nice conversation with myself here. Just found
this :

http://dev.opera.com/articles/view/timing-and-synchronization-in-javascript/

------------------------------------
Timing of Rendering

Programmatic changes to the DOM or style sheet might not render immediately.
It depends on the browser.

For example, if the background color of an element is changed through the
DOM, the DOM will immediately reflect the change (and the DOM mutation event
will be dispatched immediately and synchronously), but we do not know for
certain when the browser engine will come around to actually rendering the
changes visually on the screen. While it seems that in Mozilla and Internet
Explorer the changes are postponed until the current event dispatch has
completed, these changes seem to be rendered immediately in Opera.
---------------------





PragueExpat wrote:
> 
> Why does the following function wait until after the while loop is
> finished to update the #timer css? It happens in IE and Firefox  - I'm
> (still) using jQ 1.1.2.
> 
> function wait(time){
>   $("#timer").css("display","block");
>   time = time * 1000;
>   var sleeping = true;
>   var now = new Date();
>   var startingMSeconds = now.getTime();
>   while(sleeping){
>     alarm = new Date();
>     alarmMSeconds = alarm.getTime();
>     if(alarmMSeconds - startingMSeconds > time){ sleeping = false; }
>   }
> }
> 

-- 
View this message in context: 
http://www.nabble.com/I-thought-I-understood-threads...-tf4096371s15494.html#a11648610
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to