Ver Mensaje Individual
  #7 (permalink)  
Antiguo 04/06/2005, 03:51
Avatar de caricatos
caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años, 1 mes
Puntos: 1284
Hola otra vez:

Si bien funciona, me parece que lo hace de una forma que no es la esperada:

Hice este código con las 3 opciones:

Código:
<html>
<head>
<script>
function camb_imag() {
setTimeout("tiempo(0)", 100);
}
function tiempo(i) {
document.imagen.width=document.imagen.width+1;
if (i++ < 10) setTimeout("tiempo(" + i + ")", 100);
}
function tiempo2() {
document.imagen.width=document.imagen.width+1;
if (i++ < 10) setTimeout("tiempo2(" + i + ")", 100);
}
function camb_imag3() {
for (i = 0; i < 10; i ++)
setTimeout("tiempo2()", 100 * i);
}

i=0; 
function camb_imag2() { 
  document.imagen.width=document.imagen.width+i; 
  i++; 
  if (i<10) setTimeout('camb_imag2()', 100); 
} 

</script>
</head>
<body>
<img src="../miemoticon.gif" name="imagen" />
<input type="button" onclick="camb_imag()" value="probar"/>
<input type="button" onclick="i = 0; camb_imag2()" value="probar2"/>
<input type="button" onclick="i = 0; camb_imag3()" value="probar3"/>
</body>
</html>
Puedes copiarlo y pegarlo directamente en mi probador: http://www.pepemolina.com/probador/index.html

El botón probar2 es tu implementación y los otros son las 2 implementaciones que planteé. El efecto es menos progresivo...

Bueno. Curiosidades.

Saludetes
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo