Page 1 of 1
Preloader
Posted: Sun Jun 22, 2003 8:44 am
by mikusan
Hi, i am looking for a site preloader... similar to flash preloader, but it has to preload all of my graphics before it displays the site... now PHP would be the best solution, but i am openminded to anything...
Thanks
Posted: Sun Jun 22, 2003 9:47 am
by AVATAr
but, im thinking, php is server side... what you want to achieve is client side, or not?
Posted: Sun Jun 22, 2003 10:42 am
by mikusan
Yes... well perhaps i am thinking too fast ahead of me... but i would like to load all the images to the clien't's temporrary cache... i guess PHP is not the one to do tis but how would i do it...anyone know?
Posted: Sun Jun 22, 2003 10:44 am
by nielsene
I beleive many sites use JavaScript to handle this. In fact almost any JavaScript book has an example script for it.
Posted: Sun Jun 22, 2003 10:49 am
by cactus
Possably OT, but, in my experience preloading images is only useful when there are a lot of small images (file-size) that are going to be needed on a subsequent page.
Personally, I would question why you need to force your client (user) to wait for the preloading to finish before he/she sees the page (dependant on browser too).
Just an observation.
Regards,
Posted: Sun Jun 22, 2003 10:59 am
by mikusan
Peronally i don't like them never used them... but since i am building sites for others sometimes people don't quite listed to your suggestions and want to do it "their" way... this customer saw somewhere this thing and wants it at all cots... well... yea... thanks guys I will look into some Java Script for this one...

My attempt at a bit of help.
Posted: Sun Jun 22, 2003 1:37 pm
by HungryMind
I think this may work, I am not sure, though. Someone correct me if I am wrong or if I forgot something. This is javascript, by the way.
Code: Select all
<script language="JavaScript">
<!-- hide me
var count = 0;
function preLoad() {
home = new Image();
home.onload = loadCheck;
home.src = "buttonportfolioover.gif";
home = new Image();
home.onload = loadCheck;
home.src = "buttonsfbayareaover.gif";
home = new Image();
home.onload = loadCheck;
home.src = "buttonlongdistanceover.gif";
home = new Image();
home.onload = loadCheck;
home.src = "buttonpressandrelatedover.gif";
home = new Image();
home.onload = loadCheck;
home.src = "buttondecorativepaintingover.gif";
}
function loadCheck() {
count++;
if (count == 2) {
alert("All images loaded properly.");
}
}
// end hide -->
</script>
EDIT: Of course, you have to change the image names. I basically took this straight out of one of my past sites. Tell me if this helps.