View Full Version : Crazy Page Loading
unikrl8
November 17th, 2005, 12:45 AM
www.crazysauce.com
I'm happy with the design and everything, but in FF the background images load dead-last, which is a problem because of my image-heavy homepage. In IE the background image for the far right side loads last, which is also retarded looking. I tried using the javascript to make it *preload* shown below to no avail. (It's still on the page so you can view source if you want.
I did the whole...
var a = new Image;
a.src="images/sidez.jpg";
thing.
It's not a big deal but I figured someone here would know what was up :)
I feel like such a dork having a flash-free website mentioned on this forum :)
-Karl
RabBell
November 17th, 2005, 09:41 AM
if you're using dreamweaver when you add a rollover to a page dreamweaver automatically adds in some javascript functions, one of which is called MM_Preloadimages()
it then adds this to the body onload tag so you can preload some images
<body onload="MM_preloadimages('image1.jpg')">
kinda thing
if you don't have DreamWeaver, heres the functions (yes you need all 4)
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
unikrl8
November 17th, 2005, 10:49 PM
Sweet thanks I'm gonna try it right now.... update in 5 minutes.
unikrl8
November 17th, 2005, 11:03 PM
No Dice! It still doesnt display the background graphical images until the end! =-o
I think it could be something weird with firefox. I think the images may be downloaded first, but they arent applied to the page until the rest loads?
-Karl
Update:I did a lame quitter thing, I changed the index page to a random one that says welcome, using the typical page formatting, that forwards to the main page fater 3 seconds.
Lame, but it works.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.