0
I got the following javaScript
:
var imagem = [];
for (i = 0; i < quantasImagens; i++) {
tMin = t + tempoTransicao;
tMax = t + tamanhoIntervalos;
t+=tamanhoIntervalos;
if(i==0) tMin=0;
if(i==quantasImagens) tMax=100;
imagem[i][0] = tMin + "% { margin-left:-" + tempoImagens + "%};";
imagem[i][1] = tMax + "% { margin-left:-" + tempoImagens + "%};";
tempoImagens+=100;
}
for (po=0; po<imagem.length; i++) {
document.write(imagem[i][0]);
document.write("<br />");
document.write(imagem[i][1]);
document.write("<br />");
document.write("<br />");
}
when the is makes the second cycle, gives error in the line:
imagem[i][0] = tMin + "% { margin-left:-" + tempoImagens + "%};";
Saying that index 0 does not exist.
Where am I going wrong?
var image = []; Wrong? Note: I have tried new Array()
– Carlos Rocha
Within each
imagem[i]
has another array that you tb did not declare. Inside the loop.– bfavaretto
But that’s what I’m asking. Teach me to declare I’ve done [[]] it didn’t work either.
– Carlos Rocha