Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preload images, HOW??

Status
Not open for further replies.

Qwark

Programmer
Sep 26, 2000
59
NL
Hello,

I use the mouseover command in my site. Images wich I use in the mouseover command, start loading at the same time. But they must start loading when the page is loading, for example I must use a function wich start loading images by use the 'onload' event. I know there is a way to preload the images. But How?? Can anyone help me??
By the way I not want to see the images after loading, I must see the images after start the mouseover command. It's only for speed up my page.

Sorry for incorrect English

Qwark
 
if (document.images){
image1on = new Image (); image1on.src = "/images/javascript.gif";
image2on = new Image (); image2on.src = "/images/html.gif";}


name ure image image1 (image2) inside the img tag.
This will preload ure images

Put the script in the head tag. Everything u put in the head will be loaded before any other content on the page


MiQ
mcvdmvs@mcvdmvs.net
Yeah, well, erhm, ok... I'm busy trying to teach myself JavaScript, C++, Java and other webrelated stuff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top