<script type="text/javascript">
//var timer=null;
window.onscroll=function(){
var scrollT=document.documentElement.scrollTop||document.body.scrollTop;
var top=scrollT+(document.documentElement.clientHeight-$("box").offsetHeight)/2;
showmove(top);
}
function showmove(target){
var timer=null;
clearInterval(timer);
timer=setInterval(function(){
var timer=null;
var speed=(target-$("box").offsetTop)/8;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if ($("box").offsetTop==target) {
clearInterval(timer);
}else{
$("box").style.top=$("box").offsetTop+speed+"px";
document.title=speed;
$("box1").style.top=$("box").offsetTop+speed+"px";
}
},100)
}
function $(id){
return document.getElementById(id);
}
</script>
李晓健
相关分类