I do agree with Lasse Reichstein Nielsen that if the page is useless without
the background then redesign it.
On the other hand, why don't you look at the problem from the other
way. How can I hide the contents until the picture(s) are loaded ?
Use the following statement to hide everything inside a DIV:
document.getElementById("YourDivID").style.display = "none";
Use the following statement to show everything inside a DIV:
document.getElementById("YourDivID").style.display = "";
"Lasse Reichstein Nielsen" <lrn@hotpop.com> wrote in message
news:8yq6lk1m.fsf@hotpop.com...[color=blue]
> "Keiron Waites" <webmaster@-NOSPAM-sharemonkey.com> writes:
>[color=green]
> > Is there any JavaScript that can force the download of an image or a[/color][/color]
list of[color=blue][color=green]
> > images before the HTML, or any other images are downloaded?[/color]
>
> Not before all the HTML (the script has to come from somewhere), but
> you can start downloading simultaneously (up to the browsers limit of
> simultaneous connections).
>
> <script type="text/javascript">
>
> function preloadImg(src) {
> var dummy = new Image();
> dummy.src=src;
> }
> preloadImg("background.png");
> preloadImg("img1.png");
> preloadImg("img2.png");
> preloadImg("img3.png");
>
> </script>
>[color=green]
> > This is necessary so I can force the background image to download
> > before anything else does.[/color]
>
> This will not pause the HTML while you load the background.
>
> If your page is unusable unless the background image is loaded,
> then you should redesing your page.
>
> /L
> --
> Lasse Reichstein Nielsen -
lrn@hotpop.com
> Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
> 'Faith without judgement merely degrades the spirit divine.'[/color]