Preload many images

A

Albert Spencil

I have tried several preload scripts found here; plus, some of my own.
The only thing that works is the unsophisticated loading of those
tiny images. The download consist of 100+ images amounting to 50+mb;
and, normally completes in less than 1 minute without preload (using
DSL). The preload terminates after 6 or 7
images and seems to time-out in the middle of an image. A reload will
download a few more, etc. I have used the <body onLoad=function()>
approach as well as the
non-function approach of JS that executes immediately with the page's
loading.
Getting the same results with Netscape-7 and IE-6.

I need to add: The source of the array containing the image
references is a '.js' file. That doesn't seem pertinent as some of the
images always load.

Got any ideas??

Tx Albert Spencil
 
J

Juliette

Albert said:
I have tried several preload scripts found here; plus, some of my own.
The only thing that works is the unsophisticated loading of those
tiny images. The download consist of 100+ images amounting to 50+mb;
and, normally completes in less than 1 minute without preload (using
DSL). The preload terminates after 6 or 7
images and seems to time-out in the middle of an image. A reload will
download a few more, etc. I have used the <body onLoad=function()>
approach as well as the
non-function approach of JS that executes immediately with the page's
loading.
Getting the same results with Netscape-7 and IE-6.

I need to add: The source of the array containing the image
references is a '.js' file. That doesn't seem pertinent as some of the
images always load.

Got any ideas??

Tx Albert Spencil

Albert,

If you show us some code, we may be able to help.

J.
 
A

Albert Spencil

Juliette said:
Albert,

If you show us some code, we may be able to help.

J.

OK. This is a very simple one. For NS4.7 it preloads anywhere from 2
to all (79). For NS7x it preloaded 7 and on restores it downloaded a
few more each time. For IE6 it consistently preloads just the last
image (#79).

<script src='imageFile.js'></script> // contains the array 'pics'
<script language='javascript'><!--
/*-------------Function to preload images----------------*/

function doPreload()
{

for(loop = 0; loop < pics.length; loop++)
{
var an_image = new Image();
an_image.src = pics[loop];
}
}
/*-------------------------------------------------------------------*/
//-->
</script>
</head>
<body onLoad=doPreload() bgcolor="#004f00" text="#ffffff"
link="#ffffff" vlink="ffffff" alink="ffff48">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top