<script> function Animation(target,targetProperty,closure,precisi " /> 被老总按在办公桌吸奶头,精品日韩视频,国产亚洲人成在线视频

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

javascript動(dòng)畫(huà)效果類封裝代碼

<input id=output3 style="position:absolute;top:300;left:300;"/>
<input id=output1 />
<input id=output2 />
<br/>
<input id=output4 />

<script>
function Animation(target,targetProperty,closure,precision)
{
  closure=closure||function(x){return x;};
  precision=precision||10;
  this.handle;

  var beginTime=new Date();
  var stopTime=new Date();
  this.Begin=function(){
    beginTime=new Date();
    this.handle=setInterval(
      function(){
        var now=new Date();
        target[targetProperty]=closure(now.getTime()-beginTime.getTime());
      },
      precision
    );
       }

  this.Continue=function(){
    var now=new Date();
    beginTime.setTime(now.getTime()-stopTime.getTime()+beginTime.getTime());

    this.handle=setInterval(
      function(){
        var now=new Date();
        target[targetProperty]=closure(now.getTime()-beginTime.getTime());
      },
      precision
    );
  }

  this.Stop=function(duration){

    clearInterval(this.handle);

    if(duration===undefined)
    {
      stopTime=new Date();
      duration=stopTime.getTime()-beginTime.getTime();
    }
    else stopTime.setTime(beginTime.getTime()+duration)
    target[targetProperty]=closure(duration);
  }
}

function StoryBoard(Duration,onfinish,flag)
{
  onfinish=onfinish||function(){};
  var r=new Array();
  r.appendAnimation=function(animation)
  {
    if(animation instanceof Animation)
      this.push(animation);
  }
  r.removeAnimation=function(animation)
  {
    for(var i=0;i<r.length;i++)
    {
      if(r[i]==animation)
      {
        r.splice(i,1);
        break;
      }
    }
  }
  r.start=function(){    
    for(var i=0;i<r.length;i++)
    {
      r[i].Begin();
    }
    setTimeout(
      function(){
        for(var i=0;i<r.length;i++)
        {
          r[i].Stop(Duration);
        }
      },
      Duration
    );
    onfinish();
  }
  return r;

}
//////////////////////////////下面是使用方法////////////////////////////////
function $(id)
{
   return document.getElementById(id);
}
var a1=new Animation($("output1"),"value");
var a2=new Animation($("output2"),"width",function(x){return Math.floor(x/10);});
var a3=new Animation($("output3").style,"filter",function(x){return "alpha(opacity="+Math.floor(x/5000*100)+")";});
var a4=new Animation($("output4").style,"width",function(x){return Math.floor(x*x*x/50000/5000)+"px";});
var s=new StoryBoard(5000);
s.appendAnimation(a1);
s.appendAnimation(a2);
s.appendAnimation(a3);
s.appendAnimation(a4);
s.start();

</script>
<pre>
output1是改變value
output1是改變寬度
output3是淡入
output4是帶緩動(dòng)的寬度
</pre>

JavaScript技術(shù)javascript動(dòng)畫(huà)效果類封裝代碼,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 久久免费看少妇高潮A片2012 | 色狠狠一区 | 国偷自产视频一区二区久 | 色婷婷国产麻豆AV | AV午夜午夜快憣免费观看 | caoporen超碰在线视频 | 亚洲欧美中文字幕先锋 | 日本漂亮妈妈7观整有限中 日本片bbbxxx | 国产性色AV内射白浆肛交后入 | 蜜芽视频在线观看视频免费播放 | sihu国产精品永久免费 | 亚洲精品自在线拍2019 | 在线中文字幕亚洲日韩 | 中文字幕在线观看亚洲 | av影音先锋天堂网 | 中文字幕福利视频在线一区 | 日本无码毛片久久久九色综合 | 伊人久久大香线蕉资源 | 秋霞最新高清无码鲁丝片 | 免费毛片在线播放 | 久久88综合 | 三级黄视频 | 国产精品自在拍在线播放 | 午夜伦伦电影理论片大片 | 国产成人在线视频播放 | 十九岁在线观看免费完整版电影 | 公和熄洗澡三级中文字幕 | 97人人碰免费视频公开 | 2020美女视频黄频大全视频 | 国产精品自产拍在线观看网站 | java农村野外妇女hd | 免费观看男生桶美女私人部位 | 黄小飞二人转 | 旧里番ovaの催○セイ活指导 | 最近中文字幕高清中文 | 最新无码专区在线视频 | 偷窥wc美女毛茸茸视频 | 成片在线看一区二区草莓 | 97欧美精品大香伊蕉在人线 | 中国老太婆xxxxx | 手机在线免费 |