PDA

View Full Version : Wait at least ....



freddybee
06-19-2002, 11:41 AM
I do have a preloader with an animation.
Each time an image is loaded, the animation continue.

On slow systems, the animation is seen but on fast connexion, the animation is to fast to be seen.

How could I do to achieve something like :

Wait until it is done (image.complete) and at least 1 seconde ??

Thanks for your help and support :o

(PS : I hope it is clear but english is not my mother tongue :thumbsup: )test

Zvona
06-19-2002, 11:51 AM
This is something I written in CodeGuru Forums (http://www.codeguru.com/forum) a while ago. It continues proceeding the script after window has closed. I modified it with oImage.complete comparison.

<script type="text/javascript">
var oImage = new Image();
oImage.src = "yourImage.gif";

ivCheck = setInterval('zCheck(oImage)',100);

function zCheck(obj)
{
if (obj.complete)
{
clearInterval(ivCheck);
zContinue();
}
}

function zContinue()
{
// functions you want to execute after child
// window closing
}
</script>

Note : I'm not 100% certain about red part of code, because I've never used compelete property for functions like this one. But, basic idea of this script is tested to be correct