加载中请稍候...... function DoubleAnimation(target,targetProperty,from,to,Duration) { this.Begin=function anonymous() { target[targetProperty]=from; var starttime=new Date(); setTimeout(StoryBoard(),1); function StoryBoard() { return function() { var now=new Date(); var d=now.getTime()-starttime.getTime(); target[targetProperty]=Math.round(from+(to-from)*d/Duration); if(d<Duration)setTimeout(StoryBoard(),10); } } } } var story=new DoubleAnimation(highlight.style,"left",-100,100,1300) setInterval("story.Begin()",1300); [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]