<div class="codetitle"> <span><a style="CURSOR: pointer" data="87262" class="copybut" id="copybut87262" onclick="doCopy('code87262')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code87262"> <br><script type="text/javascript"> <br>var scrollDelay=10;//자세한 내용 보기 <br>var Scroll=document.getElementById("scroll"); <br>var Scroll2=document.getElementById("scroll2"); <br>var currentTop=0,preTop=0,stoptime=0,stopscroll=false; <br>var ScrollChild=Scroll.getElementsByTagName("li"); <br>var ScrollHeight=Scroll.offsetHeight; <br>function ScrollInfo(){ <br>if(stopscroll==true) return; <br>현재상단 ; <br>if(currentTop 1>=ScrollHeight){ <br>currentTop--; <br>정지시간 ; <br>if(stoptime==parseInt(ScrollHeight)*scrollDelay) { <br>currentTop=0; <br>정지시간=0; <br>} <br>}else{ <br>preTop=Scroll.scrollTop; <br>Scroll.scrollTop ; <br>if(preTop==Scroll.scrollTop){ <br>Scroll.scrollTop=Scroll2.offsetHeight-ScrollHeight; <br>Scroll.scrollTop =1; <br>} <br>} <br>} <br>function Int_Scroll(){ <br>Scroll2.innerHTML=""; <br>Scroll2.innerHTML=Scroll.innerHTML; <br>Scroll.innerHTML=Scroll2.innerHTML Scroll2.innerHTML; <br>Scroll.onmouseover=function(){ <br>stopscroll=true; <br>} <br>Scroll.onmouseout=function(){ <br>stopscroll=false; <br>} <br>setInterval("ScrollInfo()",scrollDelay); <br>} <br>window.setTimeout("Int_Scroll()",1000); <br></script><br> </div> <br><div class="htmlarea"><textarea id="runcode70914"> <title>제목 없음</title> <style type="text/css"> .kefuchu{ width:109px;} .SS_dh1{background:url(../images/SSindex/SS_dh1.jpg) no-repeat; height:51px; width:84px; float:left} .SS_dh2{background:url(../images/SSindex/SS_dh2.jpg) no-repeat; height:51px; width:25px; float:left; display:block} .SS_dh3{background:url(../images/SSindex/SS_dh3.jpg) repeat-y; width:109px; } .SS_dh4{background:url(../images/SSindex/SS_dh4.jpg) no-repeat; height:17px; width:109px; } .SS_dh5{background:url(../images/SSindex/SS_dh5.jpg) no-repeat; height:23px; width:74px; margin-left:20px;} #scroll li{float:left;width:150px;} #scroll2{display:none;} </style> <div> <ul style="width:500px;height:20px;overflow:hidden;border:1px red solid;line-height:20px;" id="scroll"> <li>脚本 지가</li> <li>jb51.net</li> <li>看书了</li> <li>kanshule.com</li> <li>좋은 학교</li> <li>发生大幅6</li> <li>发生大幅7</li> <li>发生大幅8</li> <li>发生大幅9</li> <li>发生大幅10</li> <li>发生大幅11</li> <li>发生大幅12</li> <li>发生大幅13</li> <li>发生大幅14</li> <li>发生大幅15</li> <li>发生大幅16</li> <li>发生大幅17</li> <li>发生大幅18</li> <li>发生大幅19</li> <li>发生大幅20</li> </ul> <ul id="scroll2"></ul> </div> </textarea></div> <br><input onclick="runEx('runcode70914')" type="button" value="运行代码"><input onclick="doCopy('runcode70914')" type="button" value="复制代码"> <input onclick="doSave(runcode70914)" type="button" value="保存代码"> <a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">[Ctrl A 전체选 注:</a>如需引入외부Js需刷新才能执行]<script type="text/javascript"> var scrollDelay=10;//数字越大速度越慢 var Scroll=document.getElementById("scroll"); var Scroll2=document.getElementById("scroll2"); var currentTop=0,preTop=0,stoptime=0,stopscroll=false; var ScrollChild=Scroll.getElementsByTagName("li"); var ScrollHeight=Scroll.offsetHeight; function ScrollInfo(){ if(stopscroll==true) return; currentTop++; if(currentTop+1>=ScrollHeight){ currentTop--; stoptime++; if(stoptime==parseInt(ScrollHeight)*scrollDelay) { currentTop=0; stoptime=0; } }else{ preTop=Scroll.scrollTop; Scroll.scrollTop++; if(preTop==Scroll.scrollTop){ Scroll.scrollTop=Scroll2.offsetHeight-ScrollHeight; Scroll.scrollTop+=1; } } } function Int_Scroll(){ Scroll2.innerHTML=""; Scroll2.innerHTML=Scroll.innerHTML; Scroll.innerHTML=Scroll2.innerHTML+Scroll2.innerHTML; Scroll.onmouseover=function(){ stopscroll=true; } Scroll.onmouseout=function(){ stopscroll=false; } setInterval("ScrollInfo()",scrollDelay); } window.setTimeout("Int_Scroll()",1000); </script>