Preloader will nicht...
Christoph
- javascript
Hallo,
bin schon kurz vorm verzweifeln, hoffe ihr könnt helfen..
Hab hier ein Preloader Script das irgendwie nicht richtig will...
Mir scheint so das es die im Array angegeben Daten Lädt nur funktioniert der Lade Balken nicht..
Hier das in Script Aktion(Is nur Probe halber):
http://www.cliffy.de/test/
Danke an alle
Gruss Christoph
Und hier was für die Augen:
<script language="JavaScript1.1">
var locationAfterPreload = "index_start.php" // URL of the page after preload finishes
var lengthOfPreloadBar = 499 // Length of preload bar (in pixels)
var heightOfPreloadBar = 1 // Height of preload bar (in pixels)
// Put the URLs of images that you want to preload below (as many as you want)
var yourImages = new Array("img/background1.gif","img/buttonkontakt.gif","img/buttonwebdesign.gif","img/buttonschreibarbeit.gif","img/logo.png","img/nav.gif","img/seite_back.gif","img/top.gif")
// Do not modify anything beyond this point!
if (document.images) {
var dots = new Array()
dots[0] = new Image(1,1)
dots[0].src = "images/start/preload_back.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size)
dots[1] = new Image(1,1)
dots[1].src = "images/start/preload_status.gif" // color of bar as preloading progresses (same note as above)
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)
}
// end hiding -->
</script>
Hallo,
bin schon kurz vorm verzweifeln, hoffe ihr könnt helfen..
Hab hier ein Preloader Script das irgendwie nicht richtig will...
Mir scheint so das es die im Array angegeben Daten Lädt nur funktioniert der Lade Balken nicht..Hier das in Script Aktion(Is nur Probe halber):
http://www.cliffy.de/test/
Danke an alle
Gruss Christoph
Und hier was für die Augen:
<script language="JavaScript1.1">
var locationAfterPreload = "index_start.php" // URL of the page after preload finishes
var lengthOfPreloadBar = 499 // Length of preload bar (in pixels)
var heightOfPreloadBar = 1 // Height of preload bar (in pixels)
// Put the URLs of images that you want to preload below (as many as you want)
var yourImages = new Array("img/background1.gif","img/buttonkontakt.gif","img/buttonwebdesign.gif","img/buttonschreibarbeit.gif","img/logo.png","img/nav.gif","img/seite_back.gif","img/top.gif")
// Do not modify anything beyond this point!
if (document.images) {
var dots = new Array()
dots[0] = new Image(1,1)
dots[0].src = "images/start/preload_back.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size)
dots[1] = new Image(1,1)
dots[1].src = "images/start/preload_status.gif" // color of bar as preloading progresses (same note as above)
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)
}
// end hiding -->
</script>
Das Ganze ist etwas kompliziert, ich würde mal versuchen, eine Tabelle mit bestimmter Hintergrundfarbe zu erstellen und diese als Ladebalken zu verwenden (vielleicht schreibe ich auch mal ein Skript dazu), die Breite der Tabelle entspricht dann des Ladestatus!
Marc Reichelt || www.marcreichelt.de
Hallo,
Das Ganze ist etwas kompliziert, ich würde mal versuchen, eine Tabelle mit bestimmter Hintergrundfarbe zu erstellen und diese als Ladebalken zu verwenden (vielleicht schreibe ich auch mal ein Skript dazu), die Breite der Tabelle entspricht dann des Ladestatus!
Mein Script entspricht der gleichen Funktion nur das ich anstatt der Tabelle die Grafik vergrössere...
Gruss
Chris