javascriptアニメーション効果のパッケージコード
2536 ワード
<input id=out put 1 />
<スクリプト;function Animation(target,target Property,closure,precision){ closure=closure function(x){return} x;;;; precision=precision𞓜10; this.handle var beginnTime=new Date(); var stopTime=new Date(); this.Begin=function(){ beginnTime=new Date(); this.handle=set Interval( function(){ var now=new Date(); target[target Property]=closure(now.getTime)-beging Time.getTime(); }, precision ); } this.Continue=function(){ var now=new Date(); BeginnTime.setTime(now.getTime)-stopTime.getTime()+beging Time.getTime(); this.handle=set Interval( function(){ var now=new Date(); target[target Property]=closure(now.getTime)-beging Time.getTime(); }, precision ); } this.Stop=function{duration} clear Interval(this.handle); if(duration==undefined) { stopTime=new Date(); duration=stopTime.getTime()-beging Time.getTime() } else stopTime.setTime(beging Time.getTime()+duration) target[target Property]=closure(duration); } } 機能 StorryBoard(Duration、onfinish、flags){ onfinish=onfinish function(){} var r=new Aray() r.apendAnimation=function(animation) { if(animation) instance of アニメーション this.push(animation) } r.removeAnimation=function(animation) { for(var) i=0;i
<スクリプト;function Animation(target,target Property,closure,precision){ closure=closure function(x){return} x;;;; precision=precision𞓜10; this.handle var beginnTime=new Date(); var stopTime=new Date(); this.Begin=function(){ beginnTime=new Date(); this.handle=set Interval( function(){ var now=new Date(); target[target Property]=closure(now.getTime)-beging Time.getTime(); }, precision ); } this.Continue=function(){ var now=new Date(); BeginnTime.setTime(now.getTime)-stopTime.getTime()+beging Time.getTime(); this.handle=set Interval( function(){ var now=new Date(); target[target Property]=closure(now.getTime)-beging Time.getTime(); }, precision ); } this.Stop=function{duration} clear Interval(this.handle); if(duration==undefined) { stopTime=new Date(); duration=stopTime.getTime()-beging Time.getTime() } else stopTime.setTime(beging Time.getTime()+duration) target[target Property]=closure(duration); } } 機能 StorryBoard(Duration、onfinish、flags){ onfinish=onfinish function(){} var r=new Aray() r.apendAnimation=function(animation) { if(animation) instance of アニメーション this.push(animation) } r.removeAnimation=function(animation) { for(var) i=0;i
output 1は、value output 1を変更する幅out put 3は、out put 4にフェードアウトする幅です。