`
kaoyudu
  • 浏览: 37375 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

几种加减速运动效果

 
阅读更多

                   
                                                                 #box{position:absolute;background:#00CC00;border:1px solid #003300;width:50px;height:50px;top:100px;}客服果果=document.getElementById('box');要走的总路程=document.body.clientWidth-客服果果.offsetWidth;setInterval(function (){var 下一次预计累计距离=parseInt(box.style.left)*1.2;if(下一次预计累计距离>要走的总路程)下一次预计累计距离=要走的总路程;客服果果.style.left=下一次预计累计距离;},20) b=1;m=document.body.offsetWidth-120;t=truesetInterval("c=parseFloat(a.style.left);if(c>m){t=false}else if(cb=1;m=document.body.offsetWidth-120;t=truesetInterval("c=parseFloat(a.style.left);if(c>m){t=false;b=1}else if(cfunction move(){var impetus=0.01;var moveArea={left:0,right:600};var obj=document.getElementById("img1");obj.direction=1;obj.speed=1;obj.maxSpeed=100;obj.interval=0;function startMove(){if(parseInt(obj.style.left)moveArea.right){obj.style.left=parseInt(obj.style.left)obj.direction=parseInt(obj.style.left)}obj.style.left=parseFloat(obj.style.left)+obj.direction*obj.speed+"px";obj.speed=obj.speed>obj.maxSpeed?1:obj.speed*(1+impetus);}setInterval(startMove,10);}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics