首页 新闻 会员 周边 捐助

JS脚本求详解

0
悬赏园豆:50 [待解决问题]

下面这段代码什么意思啊,求详解

this.fx(function (f){
            for (var i = 0, j = imgs.length; i < j; i++)
                it.setView(imgs[i],
                    f(data[i+1][0],data[i][0]), f(data[i+1][1],data[i][1]),
                    f(data[i+1][2],data[i][2]), f(data[i+1][3],data[i][3])
                )
        },{
            init:function (){
                for (var i = 0, j = imgs.length; i < j; i++)
                    imgs[i].style.zIndex=z[i]
            },
            end:function (){
                imgs[0].style.left='-9999px';
                it.playing=false
            }
        })

fx:function (fn, opts) {
        var D = Date, opts = opts || {}, d = +new D, thread, time = opts.time || 640,
         end = opts.end || D, z, fx = opts.fx || function(x) {
             return (x /= 0.5) < 1 ? (0.5 * Math.pow(x, 2)) : (-0.5 * ((x -= 2) * x - 2));
        };
         opts.context = opts.context || opts;
         if(opts.init && false === opts.init.call(opts.context))return;
        return thread = setInterval(function() {
            z = Math.min(1, (new D - d) / time);
            if (false === fn.call(opts.context, _, z) || z == 1)end.call(opts.context,clearInterval(thread));
        }, 10);
        function _(f, t) {return + f + (t - f) * fx(z) }
     }

五味坛的主页 五味坛 | 初学一级 | 园豆:140
提问于:2011-03-21 11:15
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册