Foros del Web » Programando para Internet » Javascript »

setInterval

Estas en el tema de setInterval en el foro de Javascript en Foros del Web. Por q no me funciona el temporizador en estas funciones??? var fade_tempo = ""; var Fade={ contador: 0, inc_step: 50, // incremento de opacidad a ...
  #1 (permalink)  
Antiguo 29/07/2007, 12:31
 
Fecha de Ingreso: marzo-2007
Mensajes: 135
Antigüedad: 17 años, 1 mes
Puntos: 0
Pregunta setInterval

Por q no me funciona el temporizador en estas funciones???

var fade_tempo = "";
var Fade={
contador: 0,
inc_step: 50, // incremento de opacidad a cada step
step: 1000, // (1step/ x milisegundos) step:100 = 10veces/segundo


InitFade:function (tipo,ide) {

this.contador = (!tipo)? 100 : 0;
tipo? Fade.fadein(ide) : Fade.fadeout(ide);

},

fadein: function (ide) {

if (DynLab.DynNav.ie4) document.all[ide].filters.alpha.opacity=this.contador;
if (DynLab.DynNav.ns) document.getElementById(ide).style.MozOpacity = (this.contador / 100);
if (DynLab.DynNav.ns && DynLab.DynNav.ie) document.getElementById(ide).style.filter = 'alpha (opacity=' + this.contador +')';

this.contador += this.inc_step;
(this.contador >= 100)? clearInterval (fade_tempo) : fade_tempo = setInterval ("this.fadein('"+ide+"')",this.step);
document.write(this.contador);
//document.getElementById(ide).style.display = 'none';
},

fadeout: function () {
if (DynLab.DynNav.ie4) document.all[ide].filters.alpha.opacity=this.contador;
if (DynLab.DynNav.ns) document.getElementById(ide).style.MozOpacity = (this.contador / 100);
if (DynLab.DynNav.ns && DynLab.DynNav.ie) document.getElementById(ide).style.filter = 'alpha (opacity=' + this.contador +')';
this.contador -= this.inc_step;
this.contador <= 0? clearTimeout(fade_tempo)&(this.contador=0) : fade_tempo = setTimeout ("this.fadeout('"+ide+"')",this.step);
}
}

Muchas gracias...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:26.