BigMage
New member
Preload klappt nicht....
Hallo!
Ich verwende ein Script um Bilder vorzuladen, dennoch hängt es sich immer beim letzten Bild auf! Warum !? (MSIE 6.0)
<meta http-eqiv="content-script-type" content="text/javascript">
<script>
<!--
startingColor = new Array()
endingColor = new Array()
var yourImages = new
Array("linkes.jpg","rechtes.jpg","blitz07.gif")
var locationAfterPreload = "index1.html"
var preloadbarWidth = 220
var preloadbarHeight = 20
var backgroundOfGradient = "#000000" startingColor[0] = "f"
startingColor[1] = "f"
startingColor[2] = "0"
endingColor[0] = "c"
endingColor[1] = "0"
endingColor[2] = "0"
var gap = 1
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%]."
// -->
</script>
Hallo!
Ich verwende ein Script um Bilder vorzuladen, dennoch hängt es sich immer beim letzten Bild auf! Warum !? (MSIE 6.0)
<meta http-eqiv="content-script-type" content="text/javascript">
<script>
<!--
startingColor = new Array()
endingColor = new Array()
var yourImages = new
Array("linkes.jpg","rechtes.jpg","blitz07.gif")
var locationAfterPreload = "index1.html"
var preloadbarWidth = 220
var preloadbarHeight = 20
var backgroundOfGradient = "#000000" startingColor[0] = "f"
startingColor[1] = "f"
startingColor[2] = "0"
endingColor[0] = "c"
endingColor[1] = "0"
endingColor[2] = "0"
var gap = 1
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%]."
// -->
</script>