Load før enter.
På min hjemmeside bruger jeg et script der loader hjemmesidens design før folk kommer ind på den. det ser således ud:<html>
<title>The Skull - Loading...</title>
<link rel="stylesheet" type="text/css" href="index.css" media="screen">
<head>
<script>
side = "http://www.deadgiraf.dk/theskull/"; //Siden, man kommer til, efter billederne er loadet.
bill = new Array("http://www.deadgiraf.dk/theskull/theskull.JPG",
"http://www.deadgiraf.dk/theskull/lina.jpg",
"http://www.deadgiraf.dk/theskull/back2.jpg",
"http://www.deadgiraf.dk/theskull/back.jpg",
"http://www.deadgiraf.dk/theskull/bg2.jpg",
"http://www.deadgiraf.dk/theskull/bg.jpg",
"http://www.deadgiraf.dk/theskull/menubg.jpg",
"http://www.deadgiraf.dk/theskull/loadlang.jpg",
"http://www.deadgiraf.dk/theskull/head.jpg",
"http://www.deadgiraf.dk/theskull/head2.jpg",
"http://www.deadgiraf.dk/theskull/head3.jpg",
"http://www.deadgiraf.dk/theskull/head4.jpg",
"http://www.deadgiraf.dk/theskull/head5.jpg",
"http://www.deadgiraf.dk/theskull/site1.jpg",
"http://www.deadgiraf.dk/theskull/site2.jpg",
"http://www.deadgiraf.dk/theskull/frame.jpg",
"http://www.deadgiraf.dk/theskull/forige.jpg",
"http://www.deadgiraf.dk/theskull/logerror.jpg",
"http://www.deadgiraf.dk/theskull/mainbg.jpg",
"http://www.deadgiraf.dk/theskull/naeste.jpg" ); //Billederne. Listen kan sagtens forstørres/formindskes.
i = -1;
tbts = 0;
function preload(img) {
if (++i != 0) {
tbts += Math.round(img.fileSize / 1024);
document.all.kbts.innerHTML = tbts;
}
if (i >= bill.length)
self.location.href = side;
else
img.src = bill[i];
}
</script>
</head>
<body bgcolor="black" style="margin: 0px;">
<table width="100%" height="100%">
<tr>
<td align="center" class="nyhed">
<span style="color: red; font-size: 20px;">
Loading The Skull...<br><br>
<span id="kbts">0</span> kBs loaded</span>
</td>
</tr>
</table>
<img src="" name="pimg" style="display: none;" onLoad="preload(this);" />
<script>
preload(document.images["pimg"]);
</script>
</body>
</html>
MEn problemet er at den viser hvor mange kb den loader og jeg vil gerne have den i procent så folk har en fornemmelse af hvor langt der er til siden er loadet.....
