Ver Mensaje Individual
  #7 (permalink)  
Antiguo 29/01/2011, 09:00
Avatar de _cronos2
_cronos2
Colaborador
 
Fecha de Ingreso: junio-2010
Mensajes: 2.062
Antigüedad: 13 años, 11 meses
Puntos: 310
Respuesta: Problema con objeto en IE

Aquí está:
Código Javascript:
Ver original
  1. hover : function(toDo){
  2.    addEvent('mouseover', toDo, this);
  3.    return P(this);
  4.   },
  5.  entrada : function(t){
  6.    var tempo = { 'lento' : 800, 'medio' : 500, 'rapido' : 200};
  7.    var tiempo = isFinite(t)?t:tempo[t], thix = P(this), incr = 20/tiempo;
  8.    thix.opacity(0);
  9.    var timer = setInterval(function(){
  10.     if(thix.opacity()>=1) timer = clearInterval(timer);
  11.     else{
  12.      thix.opacity(thix.opacity()+incr);
  13.     }
  14.    }, 20);
  15.    return P(this);
  16.   }
Y la función addEvent:
Código Javascript:
Ver original
  1. function addEvent(tipo, toDo, obj){
  2.  if(obj.attachEvent)
  3.   obj.attachEvent('on'+tipo, toDo, false);
  4.  else{
  5.   if(obj.addEventListener)
  6.    obj.addEventListener(tipo, toDo, false);
  7.   else
  8.    obj['on'+tipo]=toDo;
  9.  }
  10.  return obj;
  11. }
Saludos (:
__________________
" Getting older’s not been on my plans
but it’s never late, it’s never late enough for me to stay. "
Cigarettes - Russian Red