跪求哥哥 姐姐的答案
老师讲的时候有个地方说一直减小,到下面怎么又增大了?我看数值还是减小啊
老师讲的时候有个地方说一直减小,到下面怎么又增大了?我看数值还是减小啊
2017-07-28
window.onload=function(){var obtn=document.getElementById("btn"),timer,isTop=true;window.onscroll=function(){if(!isTop){clearInterval(timer);}isTop=false;};obtn.onclick=function(){timer=setInterval(function(){var osTop=document.documentElement.scrollTop||document.body.scrollTop, ispeed=Math.floor(-osTop/6);isTop=true;document.documentElement.scrollTop=document.body.scrollTop=osTop+ispeed;if(osTop==0){clearInterval(timer);}},30); }};
举报