How To: Preload All My Images?

S

Steven Van Dyke

Hi,

Is there a way to load all of the websites images when the page first loads?
So all the other pages come up quicker. I think I did this once by adding
them all to a page in a hidden frame. I was wondering if there is a better
way.

Steve
 
S

Stefan B Rusynko

If you really want to do it
You can load each image w/o JavaScript using a series of "dots" at the end of a page
<img src="whatever.gif" alt="" width="1" height="1">
Or w/ a std JavaScript preload at the end of a page
<script language="JavaScript"><!--
if (document.images) {
name1 = new Image(); name1.src = 'imgname1.gif';
name2 = new Image(); name2.src = 'imgname2.gif';
}
//--></script>

But remember, the page you do it in will suffer from the delay to load the images, so in the end you are not gaining anything



| Hi,
|
| Is there a way to load all of the websites images when the page first loads?
| So all the other pages come up quicker. I think I did this once by adding
| them all to a page in a hidden frame. I was wondering if there is a better
| way.
|
| Steve
|
|
 

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

Top