24/03/2007, 11:51
|
| | Fecha de Ingreso: julio-2005 Ubicación: Buenos Aires, Argentina
Mensajes: 1.304
Antigüedad: 19 años, 6 meses Puntos: 6 | |
Re: Mootools - Actualizar eventos, cambiar la funcion que ejecuta un evento Finalmente lo he logrado gracias al metodo removeEvent. Dejo el codigo por si le sirve a alguien:
Código:
var Item = new Class({
initialize: function(name)
{
this.name = name;
this.efecto = new Fx.Slide(name, {duration: 500, mode: 'horizontal'}).hide();
$(this.name).style.display = 'none';
},
toggle: function()
{
if($(this.name).style.display == 'none')
{
$(this.name).style.display = '';
var name = this.name;
var efec = this.efecto;
var uno = function()
{
alert("uno");
efec.removeEvent('onComplete', uno);
}
this.efecto.addEvent('onComplete', uno);
this.efecto.slideIn();
}else{
var name = this.name;
var efec = this.efecto;
var dos = function()
{
alert("dos");
efec.removeEvent('onComplete', dos);
}
this.efecto.addEvent('onComplete', dos);
this.efecto.slideOut();
}
},
});
Saludos! |