function pageScroll() {window.scrollBy(0,-10);scrolldelay = setTimeout('pageScroll()',100);}返回顶部if(document.documentElement.scrollTop==0) clearTimeout(scrolldelay);三·其他(来自网络)
BackTop=function(btnId){var btn=document.getElementById(btnId);var d=document.documentElement;window.onscroll=set;btn.onclick=function (){btn.style.display="none";window.onscroll=null;this.timer=setInterval(function(){d.scrollTop-=Math.ceil(d.scrollTop*0.1);if(d.scrollTop==0) clearInterval(btn.timer,window.onscroll=set);},10);};function set(){btn.style.display=d.scrollTop?'block':"none"}};BackTop('gotop');