Ir para conteúdo
Fórum Script Brasil
  • 0

Falha No Preload


gutolp

Pergunta

galera me ajudem, estou com um problema aki no meu negocinho de carregar, não estou encontrando o erro... olhem aki...

testem vocês também e vejam se o código funciona...

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta content="MSHTML 5.50.4134.100" name=GENERATOR>
</head>

<body bgcolor="#000000" leftmargin="0" topmargin="0" scroll="no" marginheight="0" marginwidth="0">
<p> 
 <script language=JavaScript>
<!--
function SymError()
{
 return true;
}
window.onerror = SymError;
//-->
</script>
 <script language=JavaScript1.2>
<!-- begin hiding
startingColor = new Array() // <-- Do not modify!
endingColor = new Array() // <-- Do not modify!
// YOU MAY MODIFY THE FOLLOWING:
var yourImages = new Array(
"ia_r1_c1.gif",
"ia_r3_c5.gif",
"ia_r2_c2.gif",
"ia_r2_c15.gif",
"ia_r1_c2.gif",
"ia_r5_c2.gif",
"ia_r5_c4.gif",
"ia_r5_c9.gif",
"ia_r5_c11.gif",
"ia_r5_c13.gif",
"ia_r4_c14.gif",
"ia_r6_c6.gif",
"ia_r7_c1.gif",
"ia_r7_c7.gif",
"baixo.jpg",
"spacer.gif") // Fill this array with the images you wish to preload
var locationAfterPreload = "ia.htm" // The script will redirect here when the preloading finishes *successfully*
var preloadbarWidth = 150 // The length of the preload bar. Should be greater than total amount of images you want to preload!
var preloadbarHeight = 10 // The height of the gradient/preload bar
var backgroundOfGradient = "#000000" // Default color while the preload bar is "filling up" #ffffff
// Color the preloadbar is starting with - enter 1st, 3rd and 5th numbers/letters of color code
startingColor[0] = "7" 
startingColor[1] = "4"
startingColor[2] = "1"
// Color the preloadbar is going to end up with - enter the 1st, 3rd and 5th numbers/letters of color code
endingColor[0] = "5"
endingColor[1] = "0"
endingColor[2] = "0"
// FOR TROUBLESHOOTING:
var gap = 2 // PLAY AROUND WITH THIS SETTING IF YOU GET A JAVASCRIPT ERROR!!! 2 is the minumum value!!!
// DO NOT MODIFY ANYTHING BEYOND THIS POINT!!!
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[i] = startingColor[i].toLowerCase();
endingColor[i] = endingColor[i].toLowerCase();
startingColor[i] = eval(startingColor[i]);
endingColor[i] = eval(endingColor[i]);
diff[i] = (endingColor[i]-startingColor[i])/num;
ones[i] = Math.floor(diff[i]);
sixteens[i] = Math.round((diff[i] - ones[i])*15);
}
endingColor[0] = 0;
endingColor[1] = 0;
endingColor[2] = 0;
i = 0, j = 0;
while (i <= num) {
hilite[i] = "#";
while (j < 3) {
 hilite[i] += convert[startingColor[j]];
 hilite[i] += 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[i] = new Image();
 preImages[i].src = "images/" + yourImages[i];
 loaded[i] = 0;
 cover[i] = 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[i] && preImages[i].complete) {
  loaded[i] = 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 = "Carregando " + currCount + " de " + imgLen + " images [" + percent + "%].";
 pending--;
 checkLoad();
 return;
}
eval("document.all.cell" + (h+1) + ".style.backgroundColor = hilite[h]");;
h++;
setTimeout("changeto()",1);
}
defaultStatus = "Carregando 0 de " + imgLen + " images [0%]."
// end hiding -->
</script>
</p>
<table height="100%" cellspacing=0 cellpadding=0 width="100%" border=0>
 <tbody> 
 <tr> 
   <td valign=center align=middle>
     <div align="center"> <br>
       <br>
       <a href="javascript:location.replace(locationAfterPreload)"><img src="teste.gif" width="310" height="285" border="0"></a> 
       <script language=JavaScript1.2>
<!-- beging hiding
document.write('<table border="0" cellpadding="0" cellspacing="1" bgcolor="##66CC00"><tr><td>');
document.write('<table border="0" cellpadding="0" cellspacing="1" bgcolor="#006600" width="' + preloadbarWidth + '"><tr height="' + preloadbarHeight + '" bgcolor="' + backgroundOfGradient + '">');
for (i = 0; i < num; i++) {
document.write('<td width="' + gap + '" id="cell' + (i+1) + '"></td>');
}
document.write('</tr></table>');
document.write('</td></tr></table>');
loadImages();
// end hiding -->
     </script>
     </div>
   </table>
<p> </p>
</body>
</html>

ele caregga as 15 imagens... so que fala q tem 16... e não passa de 15 o carregando.. o que está acontecendo?

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,7k
×
×
  • Criar Novo...