On Sat, 17 Sep 2005 12:46:32 +0200, ASM
<stephanemoriaux.NoAdmin@wanadoo.fr.invalid> wrote:
[color=blue]
>Hello,
>
>did you get back last correction of your page spa.htm ?
>
http://perso.wanadoo.fr/stephane.moriaux/truc/spa.htm
>May I delete it from my site ?[/color]
Hi Stephane!
Yes I diid - thanks alot. Please do remove it now.
[color=blue]
>Did you try it ?
>Does it work ?[/color]
Not too sure now ! Will try out your code below!
Cheers
Geoff
[color=blue]
>[color=green]
> > It is the
> >
> > picture[ig].onload = preload_imgs;
> >
> > which I don't understand.[/color]
>
>There was an error in this example !
>
>
> // starting index
> var ig = 0;
>
> // number max images
> var ig_max = 7;
>
> function preload_imgs()
> {
> if(ig < ig_max)
> {
> // Ho! What marvelous new image !
> picture[ig] = new Image();
>
> // on this new image loaded (stored in cache)
> // launch function : preload_imgs()
> // (notice : NO parenthesis !)
> picture[ig].onload = preload_imgs;
>
> // perhaps path to get this new image
> // would be of some help ?
> picture[ig].src = "pic" + ig + ".jpg";
>
> // increase index
> ig++;
> }
> // end of function
> // it's time to re-launch it if needed
> // fires only if image loading is finished
> // works exactly as 'onload' in body tag
> }
>
>// when max index is reached
>// loop of function preload_imgs() stops
>
>// to launch preloding images during javascript readind
> preload_imgs();[/color]