Avatar billede combinedesigns Nybegynder
13. juni 2005 - 18:51 Der er 1 kommentar og
1 løsning

Problemer med Preload

Jeg har et preload-script med en bar som virker fint i FireFox, men når jeg tjekker den i Internet Explorer, stopper den i slutningen.

Hvorhenne er fejlen?

Den kan ses her:
http://tinypurplepixy.frac.dk


Scriptet vist nedenunder:
------------------------------------------


<html>
<head>
<title>Tiny Purple Pixy On Pearl Seeds - Officiel Webside</title>


<script language="JavaScript1.1">
<!-- begin hiding


// You may modify the following:
    var locationAfterPreload = "http://tinypurplepixy.frac.dk/index2.php" // URL of the page after preload finishes
    var lengthOfPreloadBar = 150 // Length of preload bar (in pixels)
    var heightOfPreloadBar = 15 // 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("http://tinypurplepixy.frac.dk/images/1.gif","osvosv")

// Do not modify anything beyond this point!
if (document.images) {
    var dots = new Array()
    dots[0] = new Image(1,1)
    dots[0].src = "black.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 = "burn.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>

</head>

<body bgcolor="#000000">


<center>


<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="749" id="AutoNumber1" height="199" background="trae.gif">
  <tr>
    <td width="142" height="199"></td>
    <td width="399" background="load.gif" height="200" align="center" valign="top">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="157">
      <tr>
        <td width="100%" height="29"></td>
      </tr>
      <tr>
        <td width="100%" height="109" align="center" valign="top">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3" height="108">
          <tr>
            <td width="11%" height="108"></td>
            <td width="78%" height="108" align="center" valign="top">



<b><font face="verdana" size="2">Vent venligst<br>
Loader...</font></b><p>

<script language="JavaScript1.1">
<!-- begin hiding
// It is recommended that you put a link to the target URL just in case if the visitor wants to skip preloading
// for some reason, or his browser doesn't support JavaScript image object.
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('<p><font face="Verdana" size="1"><a href="java script:window.location=locationAfterPreload" style="none; font-weight: 700"><font color="#000000">Spring load over</font></a></font></p>')
// end hiding -->
</script>



        </td>
            <td width="11%" height="108"></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td width="100%" height="19"></td>
      </tr>
    </table>
    </td>
    <td width="208" height="199"></td>
  </tr>
</table>




</center>

</body>
</html>
Avatar billede combinedesigns Nybegynder
14. juni 2005 - 14:21 #1
ingen?
Avatar billede combinedesigns Nybegynder
16. juni 2005 - 18:38 #2
lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester