View Full Version : Preload images
perko
09-08-2004, 11:35 PM
Is there a script that can preload images ? like if you put the code in index saying "please wait for images to load" or something like that. Is there a script that can preload images for you?
perko
09-14-2004, 03:12 AM
ok, check http://bt-graphixs.net/index1.html. images arn't preloading, the bar doesn't move either. whats going on?
Terminator1138
09-14-2004, 04:57 AM
I get an Error 404 on the link!
DCElliott
09-14-2004, 05:46 AM
There is another way to preload images using only CSS and no Javascript or anything.
Create a div at the bottom of your page.<div style="visibility:hidden;">
<img src="preloadimage1.gif" alt="" />
<img src="preloadimage2.gif" alt="" />
<img src="preloadimage3.gif" alt="" />
</div>Despite being hidden, the div will download all the images from the server and cache them. This is usefull if you are using javascript image replacements or if you are using CSS rollover and don't want to have lag in showing the rollover effect.
DE
Edit: I had display:hide originally - I meant visibility:hidden;
Terminator1138
09-14-2004, 05:49 AM
DE, does the hidden div make it preload.......
DCElliott
09-14-2004, 05:59 AM
Yes the hidden div will preload. You can create a style like:.hideme {
visibility:hidden;
}and then at the end of your HTML have <img class="hideme" src="preloadimage1.gif" alt="" />
<img class="hideme" src="preloadimage2.gif" alt="" />
<img class="hideme" src="preloadimage3.gif" alt="" />as an alternative method.
DE
Terminator1138
09-14-2004, 06:00 AM
Ah, now it makes sense some........thanks for clarification.
perko
09-14-2004, 07:36 PM
but im not wanting another script. I want to keep the one Mr stilts got me. can anyone help me on that?
tmmoose
09-14-2004, 10:07 PM
http://www.bt-graphixs.net.net/images/main_01.gif
the problem maybe.net.net one too many.net
perko
09-15-2004, 03:42 AM
yeah, thanks tmmoose, that did the trick, guess I shouldn't trust copy n paste no more eh ? lol
DCElliott
09-15-2004, 03:54 AM
You have to be a real .net-picker when writing code! ;)
DE
Joe the Large
09-15-2004, 04:50 AM
You have to be a real .net-picker when writing code! ;)
DE
Booooo. :D
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.