Re: Need help with simple progress bar



Richard Gration said the following on 6/30/2006 12:02 PM:
On Fri, 30 Jun 2006 11:39:45 -0400, Randy Webb wrote:

Richard Gration said the following on 6/30/2006 11:03 AM:
On Fri, 30 Jun 2006 09:36:50 -0500, john wrote:

Why is my progress bar displayed only after it's reached 100%?
It's not, it just looks like that. Add this delay loop to the setPercent()
function:

for(j=0;j<75000;j++);
Did you test that? It doesn't do what you think it does.

I did test it. Did you?

I wouldn't be asking if I hadn't. Although I didn't have to test it to know what it was going to do.

It does exactly what I think it does in Opera 7.54, which is slow
down execution.

The way it does it is the problem. It doesn't cause a pause, it causes the UA to become unresponsive because the JS engine is executing code during that pause. Using setInterval, or setTimeout, to cause a pause doesn't cause the UA to freeze up.

It might do more

It does, see above.

... what do you think it does?

Test it in IE and the freeze up becomes more obvious.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.