var Tweener = {
    easeNone: function(t, b, c, d) {
        return c*t/d + b;
    },
easein: function(t, b, c, d) {
return c*(t/=d)*t + b; 
},
easeinout: function(t, b, c, d) {
if (t < d/2) return 2*c*t*t/(d*d) + b;
var ts = t - d/2;
return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b;
}
};
不是很明白什么意思?希望大家解释一下,谢谢.

解决方案 »

  1.   

    <script>
    var Tweener = {//定义Tweener对象
        easeNone: function(t, b, c, d) {//定义Tweener对象的easeNone属性,该属性是一个函数对象,下面类似
         return c*t/d + b;
        },
    easein: function(t, b, c, d) {
    return c*(t/=d)*t + b;  
    },
    easeinout: function(t, b, c, d) {
    if (t < d/2) return 2*c*t*t/(d*d) + b;
    var ts = t - d/2;
    return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b; 
    }
    };
    alert(Tweener.easeNone(1,4,6,2));
    </script>
      

  2.   

    var Tweener = {
      easeNone: function(t, b, c, d) {  
      return c*t/d + b;
      },  //定义本对象函数 easeNone
    easein: function(t, b, c, d) {
    return c*(t/=d)*t + b;  
    },  //定义本对象函数 easein
    easeinout: function(t, b, c, d) {
    if (t < d/2) return 2*c*t*t/(d*d) + b;
    var ts = t - d/2;
    return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b; 
    }//定义本对象函数 easeinout
    };
      

  3.   

    这就是所谓的json格式形式,只是都是定义的方法
      

  4.   

    <script>
        var Tweener = {}
        Tweener .easeNone= function(t, b, c, d) {
            return c*t/d + b;
        }
        Tweener .easein= function(t, b, c, d) {
            return c*(t/=d)*t + b;  
        }
        Tweener .easeinout= function(t, b, c, d) {
            if (t < d/2) return 2*c*t*t/(d*d) + b;
            var ts = t - d/2;
            return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b; 
        }    alert(Tweener.easeNone(1,4,6,2));
    </script>