Showing a GIF image while javascript processing is stuck
<p>I am building an application in which i am doing some lengthy(10-15 seconds) of java-script execution. I want to show a gif image while this execution is on. I have added a gif loading image and before i start processing my javascript, i set the style of div containing gif image to display:block and after javascript processing is done, i set it back to display:none. I can see the gif image apprearing but it is not showing the animation. it is stuck. this gif is a loading icon.</p>

<p>my javascript function looks somethng like this</p>

<pre><code>function jsFunc(){
// set the div containg the image to display:block
elmDivGif.style.display="block";

Here comes my operation which will take 10-15 secons to finish

// setting the image style to none
elmDivGif.style.display="none";
}
</code></pre>

<p>Is there anything wrong in this approach. I have a feel that both gif animation and js are using the same thread to run and it is only available to one at a time.</p>

<p>Please advice.</p>
