RealSuain
Grünschnabel
das script file
index.htm
Code:
var locationAfterPreload = "http://suain.screenmirror.de/home.htm"
var lengthOfPreloadBar = 150
var heightOfPreloadBar = 10
var yourImages = new Array(
"images/Bilder/button4_01.jpg",
"images/Bilder/button4_02.jpg",
"images/Bilder/button4_03.jpg",
"images/Bilder/button4_04.jpg",
"images/Bilder/button4_05.jpg",
"images/Bilder/button4_06.jpg",
"images/Bilder/button4_07.jpg",
"images/Bilder/button4_08.jpg")
if (document.images) {
var dots = new Array()
dots[0] = new Image(1,1)
dots[0].src = "images/Bilder/preload_1.gif"
dots[1] = new Image(1,1)
dots[1].src = "images/Bilder/preload_2.gif"
var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0
var loaded = new Array(),i,covered,timerID
var leftOverWidth = lengthOfPreloadBar%coverage
}
function loadImages() {
for (i = 0; i < yourImages.length; i++) {
preImages[i] = new Image()
preImages[i].src = yourImages[i]
}
for (i = 0; i < preImages.length; i++) {
loaded[i] = false
}
checkLoad()
}
function checkLoad() {
if (currCount == preImages.length) {
location.replace(locationAfterPreload)
return
}
for (i = 0; i <= preImages.length; i++) {
if (loaded[i] == false && preImages[i].complete) {
loaded[i] = true
eval("document.img" + currCount + ".src=dots[1].src")
currCount++
}
}
timerID = setTimeout("checkLoad()",10)
}
index.htm
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>@work|by|suain</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript" src="preload.js" type="text/javascript"></script>
<head>
<body bgcolor="#000000">
<
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="300" height="75" align="center" bgcolor="#000000">
<center>
<font color="#CCCCCC">preloading images, please wait...<br>
<br>
0%</font> <font color="#CCCCCC">
<script language="JavaScript1.1">
<!--
if (document.images) {
var preloadBar = ''
for (i = 0; i < yourImages.length-1; i++) {
preloadBar += '<img src="' + dots[0].src + '" width="' + coverage + '" height="' + heightOfPreloadBar + '" name="img' + i + '" align="absmiddle">'
}
preloadBar += '<img src="' + dots[0].src + '" width="' + (leftOverWidth+coverage) + '" height="' + heightOfPreloadBar + '" name="img' + (yourImages.length-1) + '" align="absmiddle">'
document.write(preloadBar)
loadImages()
}
document.write('<font color="#CCCCCC"> 100%</font><br><br><a href="javascript:window.location=locationAfterPreload">skip preloading </a>')
//-->
</script>
</font>
</center>
</td>
</tr>
</table>
</body>
</html>