Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/05/2011, 12:13
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 19 años, 11 meses
Puntos: 834
Respuesta: Ejecutar funciones fuera del objeto

Podrías generar un método vacío para luego sobreescribirlo y que funcione como pseudoevento, algo semejante a broadcasting. Un ejemplo muy rápido:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
title>Documento sin t&#237;tulo</title>
<script type="text/javascript">
function 
fadeElement(e){
       
this.element document.getElementById(e);
       
this.element.style.visibility='visible';
       
this.finish = function(){};//método vacío
       
this.timmer=0;
       
this.ejecutar=function(inicio,fin){
           if(
inicio<fin){
               
clearTimeout(this.timmer);
                
this.element.style.visibility='hidden';
                   return 
this.finish();//llamamos al método vacío
           
}
           
this.element.style.opacity=inicio;
           
this.element.style.filter='alpha(opacity='+inicio*100+')';
           var 
_self=this;
           
this.timmer=setTimeout(function(){_self.ejecutar(inicio-0.05,0)},50);
       }
       
         
}
onload=function(){
    var 
hidebox = new fadeElement("box");
    
hidebox.finish = function(){
       
alert("ya se oculto");
    }
    
hidebox.ejecutar(1,0);
}
</script>

</head>

<body>
<div id="box" style="background-color:#F00">Colocar aquí el contenido para  id "box"</div>
</body>
</html> 
Normalmente en animaciones se suele agregar para poder usar pseudoeventos como onMotionStart, onMotionProgress, onMotionFinished, etc.