PDA

View Full Version : preload


Steven
06-27-2002, 03:00 AM
I dont know if this can be done:
My site has a lot of pictures. When a visitor access my site (index.htm) will need time to read the information in this page before accessing to another pages.
I want that in this time (visitor reading a certain page) pictures in my site will be continuosly loaded to temporary internet directory of his PC.

If can do, can you help me the source code.
Thanks
Steven

glenngv
06-27-2002, 03:20 AM
var arrPix = new Array("pic1.gif","pic2.gif","pic3.gif",...);
for (var i=0;i<arrPix.length;i++){
img = new Image();
img.src=arrPix[i];
}

Steven
06-27-2002, 03:36 AM
The core of this matter is that the code is intelligent enough to not interfere the visitor if he do something else. Only use the dead (spare) time to load the pictures....

Steven