Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/10/2008, 09:45
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Movimientos agradables

Fijate si te sirve algo así:
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=iso-8859-1" />
<
title>Ejemplo</title>
<
script>
function 
css(propiedadvalor){
    if(!
valor)
        return 
this.style[propiedad];
    
this.style[propiedad]=valor;
}
function 
easing(inicio,fin,coef,propiedad,medida,pausa){
        var 
tmp=[];
        if(!
medida)medida='';
        
css.call(this,propiedad,inicio+medida);
        var 
_this=this;
        
this.pausa=pausa;
        var 
test=0;
        var 
intervalo=setInterval(
            function(){
                
tmp[test]=_this.val;
                if(
test>&& tmp[tmp.length-2]==tmp[tmp.length-1]){
                    
_this.val=fin;
                     
css.call(_this,propiedad,_this.val+medida);
                     
clearInterval(intervalo);
                     return;
                }
                
test++;
                
document.getElementById('log').innerHTML=test;
                
_this.val=parseFloat(css.call(_this,propiedad))+(fin-parseFloat(css.call(_this,propiedad)))*coef;
                
css.call(_this,propiedad,_this.val+medida);
            },
this.pausa);
}
function $(
id){return document.getElementById(id);}
onload=function(){
    
easing.call($('pp'),10,400,.09,'width','px',10);
    
easing.call($('pp'),10,400,.09,'height','px',10);
}
</script>
</head>
<body>
<div id="pp" style=" background-color:orange; color:#FFF; display:block; ">fffffff</div>
<div id="log"></div>
</body>
</html> 

Última edición por Panino5001; 05/10/2008 a las 14:39