preloader

DRXX

Erfahrenes Mitglied
Mein preloader der von javascript erzeugt ist funktioniert im Internet Explorer nicht.
Im Mozilla firefox dafür aber. Warum ?
Code:
 <script language="javascript">
 var locationAfterPreload = "index.php?file=start.php"
 var lengthOfPreloadBar = 150
 var heightOfPreloadBar = 10
 var yourImages = new Array("images/dloads.jpg",
 "images/forum.jpg",
 "images/head.gif",
 "images/home.jpg",
 "images/l.gif",
 "images/l.jpg",
 "images/login.gif",
 "images/l_o1.jpg",
 "images/l_o2.jpg",
 "images/l_u1.jpg",
 "images/l_u2.jpg",
 "images/o.gif",
 "images/o.jpg",
 "images/o2.gif",
 "images/o3.gif",
 "images/r.gif",
 "images/r.jpg",
 "images/r2.gif",
 "images/ru.gif",
 "images/ru2.gif",
 "images/r_o1.jpg",
 "images/r_o2.jpg",
 "images/r_u1.jpg",
 "images/r_u2.jpg",
 "images/tuts.jpg",
 "images/u.gif",
 "images/u.jpg",
 "images/u.png",
 "images/u2.gif",
 "images/u3.gif",
 "images/anmelden.gif",
 "images/send.gif",
 "images/news3.gif",
 "images/php2.gif",
 "images/styles.jpg",
 "images/styles.png",
 "images/save.gif",
 "images/scripts.png",
 "images/progs.png",
 "images/ps.jpg",
 "images/ps.gif",
 "images/c4d.gif",
 "images/img.gif",
 "images/url.gif",
 "images/vorschau.gif",
 "images/smiles",
 "images/amazed.gif",
 "images/amuse.gif",
 "images/angry.gif",
 "images/attention.gif",
 "images/biggrin.gif",
 "images/bigsmile.gif",
 "images/blink.gif",
 "images/cheesy.gif",
 "images/confused.gif",
 "images/cool.gif",
 "images/cry.gif",
 "images/evil.gif",
 "images/frown.gif",
 "images/laugh.gif",
 "images/mad.gif",
 "images/notice.gif",
 "images/notrust.gif",
 "images/noworry.gif",
 "images/nuts.gif",
 "images/oh.gif",
 "images/push.gif",
 "images/question.gif",
 "images/rolleyes.gif",
 "images/sad.gif",
 "images/shy.gif",
 "images/sick.gif",
 "images/smile.gif",
 "images/suspicious.gif",
 "images/thumbdown.gif",
 "images/thumbup.gif",
 "images/unsure.gif",
 "images/wink.gif",
 "images/starwow.gif",
 "images/forengott.gif",
 "images/star.gif",
 "images/redo.gif",
 "images/undo.gif",
 "images/preload_2.gif",
 "images/preload_1.gif")
 
 if (document.images) {
 var dots = new Array()
 dots[0] = new Image(1,1)
 dots[0].src = "images/preload_1.gif"
 dots[1] = new Image(1,1)
 dots[1].src = "images/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)
 }</script>


Code:
<table width="300" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <td width="300" height="75" align="center" bgcolor="#00000000000">
 
 preloading images, please wait...<br>
 <br>
 <span class="Stil1">0%</span>
 <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="#FFFFFF"> 100%</font><br><br><a href="javascript:window.location=locationAfterPreload">skip preloading </a>')
 //-->
 </script>
 
 </td>
 </tr>
 </table>
 
Dieses Skript wurde hier schon oft als Problemkind behandelt(und nicht nur hier, Google liefert dazu unzählige Treffer). Die Lösung ist oft, einen anderen Preloader zu nehmen:-)
Hier findest du einen: http://www.tutorials.de/tutorials196512.html

Der würde in deinem Fall die Extra-Eingangsseite und das nochmalige Notieren der ganzen Bilder im Array überflüssig machen:)
 

Neue Beiträge

Zurück