<style>#sys{position:relative}#apply{position:absolute;left:140px;top:60px;}</style>
<body>
<div id="sys"><img src="http://www.google.cn/logos//newton10-tree.jpg" width="384" /><img src="http://www.google.cn/logos//newton10-apple.png" width="26" id="apply"></div>
</body>
<script>
function fx(play,end,len) {
 var play=play||Date,end=end||Date,s=0,t=0,len=(len||800)/10,
  th,p=Math.pow,fx=function(x){
   if ((x) < (1/2.75)) {
    return (7.5625*x*x);
   } else if (x < (2/2.75)) {
    return (7.5625*(x-=(1.5/2.75))*x + .75);
   } else if (x < (2.5/2.75)) {
    return (7.5625*(x-=(2.25/2.75))*x + .9375);
   } else {
    return (7.5625*(x-=(2.625/2.75))*x + .984375);
   }
  },c=function(f,t){return +f+(t-f)*s};
 return th = setInterval(function() {
  var xy=t++/len;
  play(c,xy,s=fx(xy));
  if(s==1)end(clearInterval(th))
 },10);
};
setTimeout(function (){
 fx(function (x,y){
  apply.style.top=x(60,400)+'px';
  if(y>.364)apply.style.left=140+(.364-y)*80+'px'
 }) 
},2000);
</script>

posted on 2010-04-09 15:55  恋爱灰尘  阅读(179)  评论(0编辑  收藏  举报