Vorladen grht nicht? JS (Programmieren)

Vorladen grht nicht? JS (Programmieren)

wiso geht nicht was ist faltsch ?



<html>
<head>
<title>titel</title>
<script language="JavaScript1.2">
startingColor = new Array()
endingColor = new Array()
var yourImages = new Array
(
'1.gif',
'2.gif'
)
var locationAfterPreload = "index.htm"
var preloadbarWidth = 500
var preloadbarHeight = 10
var backgroundOfGradient = "#000000"
startingColor[0] = "0"
startingColor[1] = "0"
startingColor[2] = "0"
endingColor[0] = "2"
endingColor[1] = "6"
endingColor[2] = "2"
var gap = 3
if (!document.all) location.replace(locationAfterPreload)
var a = 10, b = 11, c = 12, d = 13, e = 14, f=15, i, j, ones = new Array(), sixteens = new Array(), diff = new Array();
var convert = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f", imgLen = yourImages.length;
var loaded = new Array(), preImages = new Array(), currCount = 0, pending = 0, h = 0, hilite = new Array(), cover = new Array();
var num = Math.floor(preloadbarWidth/gap);
for (i = 0; i < 3; i++) {
startingColor = startingColor.toLowerCase();
endingColor = endingColor.toLowerCase();
startingColor = eval(startingColor);
endingColor = eval(endingColor);
diff = (endingColor-startingColor)/num;
ones = Math.floor(diff);
sixteens = Math.round((diff - ones)*15);
}
endingColor[0] = 0;
endingColor[1] = 0;
endingColor[2] = 0;
i = 0, j = 0;
while (i <= num) {
hilite = "#";
while (j < 3) {
hilite += convert[startingColor[j]];
hilite += convert[endingColor[j]];
startingColor[j] += ones[j];
endingColor[j] += sixteens[j];
if (endingColor[j] > 15) {
endingColor[j] -= 15;
startingColor[j]++;
}
j++;
}
j = 0;
i++;
}
function loadImages() {
for (i = 0; i < imgLen; i++) {
preImages = new Image();
preImages.src = yourImages;
loaded = 0;
cover = Math.floor(num/imgLen)*(i+1)
}
cover[cover.length-1] += num%imgLen
checkLoad();
}
function checkLoad() {
if (pending) { changeto(); return }
if (currCount == imgLen) { location.replace(locationAfterPreload); return }
for (i = 0; i < imgLen; i++) {
if (!loaded && preImages.complete) {
loaded = 1; pending++; currCount++;
checkLoad();
return;
}
}
setTimeout("checkLoad()",10);
}
function changeto() {
if (h+1 > cover[currCount-1]) {
var percent = Math.round(100/imgLen)*currCount;
if (percent > 100) while (percent != 100) percent--;
if (currCount == imgLen && percent < 100) percent = 100;
defaultStatus = "Loaded " + currCount + " out of " + imgLen + " images [" + percent + "%].";
pending--;
checkLoad();
return;
}
eval("document.all.cell" + (h+1) + ".style.backgroundColor = hilite[h]";;
h++;
setTimeout("changeto()",1);
}
defaultStatus = "Loaded 0 out of " + imgLen + " images [0%]."
// end hiding -->
</script>
</head>
<body bgcolor="#111111">

<center>
<table cellspacing="1" cellpadding="1" style="width: 800px; height: 500px; bgcolor="#111111">
<tr>
<td bgcolor="#111111" style="text-align: center;"><font color="#888888">loading graphics...</font><br>
<center>
<script language="JavaScript1.2">
<!-- beging hiding
document.write('<table cellpadding="0" cellspacing="0" style="width: ' + preloadbarWidth + '; border: 1px solid Black;"><tr style="height: ' + preloadbarHeight + '; backgroung-color: ' + backgroundOfGradient + ';">');
for (i = 0; i < num; i++) {
document.write('<td bordercolorlight="75A0BD" bordercolordark="75A0BD" width="' + gap + '" id="cell' + (i+1) + '"></td>');
}
document.write('</tr></table>');
loadImages();
// end hiding -->
</script>

</center>
</td>
</tr>
</table>
</center

</body>
</html>
eval("document.all.cell" + (h+1) + ".style.backgroundColor = hilite[h]";;
h++;
setTimeout("changeto()",1);
}
defaultStatus = "Loaded 0 out of " + imgLen + " images [0%]."
// end hiding -->
</script>
</head>
<body bgcolor="#111111">

<center>
<table cellspacing="1" cellpadding="1" style="width: 800px; height: 500px; bgcolor="#111111">
<tr>
<td bgcolor="#111111" style="text-align: center;"><font color="#888888">loading graphics...</font><br>
<center>
<script language="JavaScript1.2">
<!-- beging hiding
document.write('<table cellpadding="0" cellspacing="0" style="width: ' + preloadbarWidth + '; border: 1px solid Black;"><tr style="height: ' + preloadbarHeight + '; backgroung-color: ' + backgroundOfGradient + ';">');
for (i = 0; i < num; i++) {
document.write('<td bordercolorlight="75A0BD" bordercolordark="75A0BD" width="' + gap + '" id="cell' + (i+1) + '"></td>');
}
document.write('</tr></table>');
loadImages();
// end hiding -->
</script>

</center>

Mit diesem schrot geht das alles nict
eval("document.all.cell" + (h+1) + ".style.backgroundColor = hilite[h]";;
h++;
setTimeout("changeto()",1);
}
defaultStatus = "Loaded 0 out of " + imgLen + " images [0%]."
// end hiding -->
</script>
</head>
<body bgcolor="#111111">

<center>
<table cellspacing="1" cellpadding="1" style="width: 800px; height: 500px; bgcolor="#111111">
<tr>
<td bgcolor="#111111" style="text-align: center;"><font color="#888888">loading graphics...</font><br>
<center>
<script language="JavaScript1.2">
<!-- beging hiding
document.write('<table cellpadding="0" cellspacing="0" style="width: ' + preloadbarWidth + '; border: 1px solid Black;"><tr style="height: ' + preloadbarHeight + '; backgroung-color: ' + backgroundOfGradient + ';">');
for (i = 0; i < num; i++) {
document.write('<td bordercolorlight="75A0BD" bordercolordark="75A0BD" width="' + gap + '" id="cell' + (i+1) + '"></td>');
}
document.write('</tr></table>');
loadImages();
// end hiding -->
</script>

</center>
und das geht
nein.
ist schon gut
Logge dich ein um einen Beitrag zu schreiben.