名稱:揚(yáng)清風(fēng)正氣過(guò)廉潔端午分類:動(dòng)畫片端午節(jié)廉政動(dòng)畫《揚(yáng)清風(fēng)正氣過(guò)廉潔端午》由鳴謙影視制作
function myEvent(obj,ev,fn){
if(obj.attachEvent){
obj.attachEvent('on'+ev,fn);
}else{
obj.addEventListener(ev,fn,false);
}
}
myEvent(window,'load',function(){
var oRTT=document.getElementById('rtt');
var pH=document.documentElement.clientHeight;
var timer=null;
var scrollTop;
window.onscroll=function(){
scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
return scrollTop;
};
oRTT.onclick=function(){
clearInterval(timer);
timer=setInterval(function(){
var now=scrollTop;
var speed=(0-now)/5;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(scrollTop==0){
clearInterval(timer);
}
document.documentElement.scrollTop=scrollTop+speed;
document.body.scrollTop=scrollTop+speed;
}, 30);
}
});