07/03/2013, 01:36
|
| | Fecha de Ingreso: agosto-2007
Mensajes: 130
Antigüedad: 17 años, 5 meses Puntos: 0 | |
Respuesta: bucle de variables y rizando mas el rizo...
funciona
Código:
obj['tagObj' + 0] = document.getElementsByTagName("video").item(0);
obj['div' + 0] = obj['tagObj' + 0].parentNode;
obj['tagObj' + 0].addEventListener('progress', function() { getPercentProg(this,obj['div' + 0]); }, false);
obj['tagObj' + 0].addEventListener('canplaythrough', function() { myAutoPlay(this,obj['div' + 0]); }, false);
obj['tagObj' + 1] = document.getElementsByTagName("video").item(1);
obj['div' + 1] = obj['tagObj' + 1].parentNode;
obj['tagObj' + 1].addEventListener('progress', function() { getPercentProg(this,obj['div' + 1]); }, false);
obj['tagObj' + 1].addEventListener('canplaythrough', function() { myAutoPlay(this,obj['div' + 1]); }, false);
obj['tagObj' + 2] = document.getElementsByTagName("video").item(2);
obj['div' + 2] = obj['tagObj' + 2].parentNode;
obj['tagObj' + 2].addEventListener('progress', function() { getPercentProg(this,obj['div' + 2]); }, false);
obj['tagObj' + 2].addEventListener('canplaythrough', function() { myAutoPlay(this,obj['div' + 2]); }, false);
no funciona...
Código:
i = 0;
obj['tagObj' + i] = document.getElementsByTagName("video").item(i);
obj['div' + i] = obj['tagObj' + i].parentNode;
obj['tagObj' +i].addEventListener('progress', function() { getPercentProg(this,obj['div' + i]); }, false);
obj['tagObj' + i].addEventListener('canplaythrough', function() { myAutoPlay(this,obj['div' + i]); }, false);
i = 1;
obj['tagObj' + i] = document.getElementsByTagName("video").item(i);
obj['div' + i] = obj['tagObj' + i].parentNode;
obj['tagObj' + i].addEventListener('progress', function() { getPercentProg(this,obj['div' + i]); }, false);
obj['tagObj' + i].addEventListener('canplaythrough', function() { myAutoPlay(this,obj['div' + i]); }, false);
i = 2;
obj['tagObj' + i] = document.getElementsByTagName("video").item(i);
obj['div' + i] = obj['tagObj' + i].parentNode;
obj['tagObj' + i].addEventListener('progress', function() { getPercentProg(this,obj['div' + i]); }, false);
obj['tagObj' + i].addEventListener('canplaythrough', function() { myAutoPlay(this,obj['div' + i]); }, false);
o sea, que debe ser tonteria lo que ocurre para que no funcione...
alguna idea de que puede ocurrir...? |