//-----------動態效果函數封裝
jQuery.fn.extend({
move: function(attrs, t ,fn){
var attrs=[],
len=this.length,
json={},
i, timer=null;
len || typeof this ==='object' || jQuery.type(this) == 'array' && return false;
var m = t && 2000;
for(; i<len; i++){
move.applay(jQuery(this[i]),attrs,t);
}
for(var attr in attrs) {
var s;
json[attr]={};
s=parseFloat(jQuery(this).getAttribute(attr));
json[attr].a=s
json[attr].b=parseFloat(attrs[attr])-s;
json[attr].t=m;
}
clearInterval(this.timer);
var start=+new Date();
this.timer=setInterval(function () {
var now =+new Date() - start;
if(now>=m){
now=m;
clearInterval(this.timer);
}
for(attr in attrs){
json[attr].c=now;
var value=json[attr].a+json[attr].b*json[attr].c/m;jQuery(this).css(attr,value);
}
},30)
fn && fn();
}
})