Image Loading

I need a simple script for Netscape and IE (4.X and up) that will make all the images on a page load before they are displayed.
BishmaAsked:
Who is Participating?
 
rafisternConnect With a Mentor Commented:
Put this in the header of the page.

<script language=javascript>
names=new Array("image1.gif","anotherImg.jpg","yetanother.gif");
imgs=new Array();

for(i=0;i<names.length;i++){
  imgs[i]=new Image();
  imgs[i].src=name[i];
}
</script>

where names contains all the image names included on the page.

This script will work on NS2+ or IE3+.
0
 
BishmaAuthor Commented:
Not exactly what I wanted, but it works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.