<div class="codetitle"> <span><a style="CURSOR: pointer" data="21473" class="copybut" id="copybut21473" onclick="doCopy('code21473')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code21473"> <br><script 언어="javascript"><br>var goto_top_type = -1;<br>var goto_top_itv = 0;<br>function goto_top_timer() {<br> var y = goto_top_type == 1 ? document.documentElement.scrollTop<br> : document.body.scrollTop;<br> var moveby = 15;<br> y -= Math.ceil(y * moveby / 100);<br> if (y < 0) {<BR> y = 0;<BR> }<BR> if (goto_top_type == 1) {<BR> document.documentElement.scrollTop = y;<BR> } else {<BR> document.body.scrollTop = y ;<BR> }<BR> if (y == 0) {<BR> clearInterval(goto_top_itv);<BR> goto_top_itv = 0;<BR> }<BR>}<BR>함수 goto_top() {<BR> if (goto_top_itv == 0) {<BR> if (document.documentElement && document.documentElement.scrollTop) {<BR> goto_top_type = 1;<BR> } else if (document.body && document.body.scrollTop) {<BR> goto_top_type = 2;<BR> } else {<BR> goto_top_type = 0;<BR> }<BR> if (goto_top_type > 0) {<br> goto_top_itv = setInterval('goto_top_timer()', 50); <br> }<br> }<br>}<br></script><br><a href="javascript:void(0)" onclick="goto_top()">【返回顶부】< ;/a><br> </div>