Web Analytics Made Easy -
StatCounter Wait at least .... - CodingForum

Announcement

Collapse
No announcement yet.

Wait at least ....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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

    Comment

    Working...
    X