Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Paris, France
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wait at least ....

    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

    (PS : I hope it is clear but english is not my mother tongue )test
    [color=dark blue]Freddy Bee[/color]

  • #2
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post
    This is something I written in CodeGuru Forums a while ago. It continues proceeding the script after window has closed. I modified it with oImage.complete comparison.
    Code:
    <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
    Zvona
    First Aid for
    Web Design


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •