Motion Frame Evolution Process Startmove (ITarget) motion frame startmove (obj, ITarget) Multi-Object Startmove (obj, attr, itarget) any value startmove (obj, attr, iTa Rget, FN) chain motion Startmove (obj, JSON) multi-valued motion Startmove (obj, JSON, FN) Perfect motion frame
functionGetStyle (obj, name) {if(obj.currentstyle) {returnObj.currentstyle[name]; } Else { returngetComputedStyle (obj,false) [name]; }}//Startmove (Odiv, {width:400, height:400})functionstartmove (obj, JSON, fnend) {clearinterval (Obj.timer); Obj.timer=setinterval (function (){ varbstop=true;//Suppose: All values are already there. for(varattrinchJSON) { varCur=0; if(attr== ' opacity ') {cur=math.round (parsefloat (GetStyle (obj, attr)) *100); } Else{cur=parseint (GetStyle (obj, attr)); } varSpeed= (json[attr]-cur)/6; Speed=speed>0?Math.ceil (Speed): Math.floor (speed); if(cur!=json[attr]) bstop=false; if(attr== ' opacity ') {Obj.style.filter= ' Alpha (opacity: ' + (cur+speed) + ') '; Obj.style.opacity= (cur+speed)/100; } Else{obj.style[attr]=cur+speed+ ' px '; } } if(bstop) {clearinterval (Obj.timer); if(Fnend) fnend (); } }, 30);}
Perfect motion Frame