subzero
Erfahrenes Mitglied
hallöchen..
Habe mir mal ein Preload Script organisiert - habe alle meine Bilder eingefügt! Aber es Preloadet gar nicht Einen Scriptfehler vom Internet Explorer bekomme ich auch ... Könnt ihr vielleicht mal mit euren Adleraugen diesen "Schmand" mal durchfliegen!
Danke schön!
nochmal danke für euer Interesse!
//edit...
ich habe das ganze mal auf meinem Webspace geuppt:
http://www.subzero-design.com/preload.htm
Habe mir mal ein Preload Script organisiert - habe alle meine Bilder eingefügt! Aber es Preloadet gar nicht Einen Scriptfehler vom Internet Explorer bekomme ich auch ... Könnt ihr vielleicht mal mit euren Adleraugen diesen "Schmand" mal durchfliegen!
Danke schön!
Code:
<html>
<head>
<script>
///////////////////////////////////////////////
// PUT ALL IMAGES IN AN ARRAY FOR PRELOADING //
///////////////////////////////////////////////
var pics = new Array("images/Abstandhalter.gif", "images/i-face_subdesign5_11.gif", "images/index2_01.gif", "images/index2_02.gif", "images/index2_03.gif", "images/index2_04.gif", "images/index2_05.gif", "images/index2_06.gif", "images/index2_07.gif", "images/index2_08.gif", "images/index2_09.gif", "images/index2_10.gif", "images/index2_11.gif", "images/index2_12.gif", "images/index2_13.gif", "images/index2_14.gif", "images/index2_15.gif", "images/index2_16.gif", "images/index2_17.gif", "images/index2_18.gif", "images/index2_19.gif", "images/index2_20.gif", "images/index2_21.gif", "images/index2_22.gif", "images/index2_23.gif", "images/index2_24.gif", "images/index2_25.gif", "images/index2_26.gif", "images/index2_27.gif", "images/index2_28.gif", "images/index2_29.gif", "images/index2_30.gif", "images/index2_31.gif", "images/index2_32.gif", "images/index2_33.gif", "images/index2_34.gif", "images/index2_35.gif", "images/index2_36.gif", "images/index2_37.gif", "images/index2_38.gif", "images/index2_39.gif", "images/index2_40.gif",);
var url = "index2.html";
// ASK USERS TO GO TO NEXT PAGE AFTER PRELOADING? //
var doConfirm = false;
// ALLOW USER TO SKIP PRELOADING? //
var canSkip = false;
////////////////////////////////////////////////////////////////////////////////////
//------------YOU ARE DONE, DON'T EDIT ANYTHING BEYOND THIS POINT-----------------//
////////////////////////////////////////////////////////////////////////////////////
var imgObjs = new Array(pics.length);
var loaded = 0;
var total = pics.length;
var cPercent = 0;
var barLayer = null;
var percentLayer = null;
var statLayer = null;
var doneMsgLayer = null;
function getLayer(layerID) {
if (document.getElementById)
return document.getElementById(layerID);
else if (document.all)
return document.all[layerID];
else
return null;
}
function updateBar() {
statLayer.innerHTML = "<font face=\"Arial\" color=\"#5B6062\"><B>" +loaded+ "/" +total+ "</B></font>";
var percent = Math.round(loaded/total * 100);
if (cPercent != percent)
{
cPercent = percent;
barLayer.style.width = (cPercent*3) +"px";
percentLayer.innerHTML = "<font color=\"#5B6062\"><B>" +cPercent+ "%</B></font>";
}
if (loaded == total)
{
doneMsgLayer.innerHTML = "<a href=\"javascript:done()\"><font face=\"Arial\" color=\"#5B606\" size=\"2\"><B></B></font></a>";
if (!doConfirm || (doConfirm && confirm("Files have finish loading, continue to next page?")))
done();
}
}
function startLoading() {
if (document.getElementById || document.all)
{
barLayer = getLayer("bar");
percentLayer = getLayer("percent");
statLayer = getLayer("stat");
doneMsgLayer = getLayer("doneMsg");
if (canSkip)
doneMsgLayer.innerHTML = "<a href=\"javascript:done()\"><font color=\"#FFCC00\" size=\"2\" face=\"Arial\">Skip Pre-Loading</font></a>";
for (i=0; i<pics.length; i++)
{
imgObjs[i] = new Image();
imgObjs[i].onload = imgLoaded;
imgObjs[i].onerror = imgFailed;
imgObjs[i].src = pics[i];
}
}
else
{
alert("You are likely running very old browser which is not compatible with preloading script. Maybe it is time to update your browser.\n\nProgram is skipping preloading.");
window.location.replace(url);
}
}
function done() {
window.location.replace(url);
}
function imgFailed() {
alert("The following image failed to load, probably a broken link:\n" +this.src+ "\nPlease contact the webmaster of the site you are visiting about this. The program will skip this file now.");
loaded++;
updateBar();
}
function imgLoaded() {
loaded++;
updateBar();
}
</script>
<LINK HREF="style.css" REL="STYLESHEET">
</head>
<body bgcolor="#002080" onLoad="startLoading()">
<center>
<div id="bg" style="position:absolute; top:205; left:50; background-color: #DDDDDD; width:300; height:60;">
<img src='images/grunge_bloody.gif' width="250" height="60"></div>
<div id="bar" style="position:absolute; top:300px; left:50px; background-color: #000000; width:1px; height:20px;"> </div>
<div id="percent" style="position:absolute; top:303px; left:190px;"><font color="#5B606"><B>0%</B></font></div>
<div id="stat" style="position:absolute; top:330px; left:192px;"><font face="Arial" color="#5B606"><B>0/0</B></font></div>
<div id="doneMsg" style="position:absolute; top:300px; left:620px;"></div>
<div id="doneMatter" style="position:absolute; top:250; left:130;">
<BR>
<!----- FEEL FREE TO ADD HTML CONTENT BELOW ----->
<!----- FEEL FREE TO ADD HTML CONTENT BELOW ----->
<!----- END HTML, PLEASE DON'T REMOVE THE COPYRIGHT INFO ----->
<!----- END HTML, PLEASE DON'T REMOVE THE COPYRIGHT INFO ----->
<BR>
</div>
</body>
</html>
nochmal danke für euer Interesse!
//edit...
ich habe das ganze mal auf meinem Webspace geuppt:
http://www.subzero-design.com/preload.htm