<html> <head> <style> .scroll{ overflow:hidden; width:100%; } .scrollout{ height:250px; width:100%; overflow:hidden; cursor:pointer; } </style> <script type="text/javascript" src="jquery.js"></script> <script> //無縫滾動 var rclone=$("#rscroll").html();//這裏要用html而不能用clone,html()方法是獲取html代碼,你是要加長html代碼,clone方法是要複製節點信息 $("#rscrollout").append(rclone);//其次,你滾動的內容長度要大於200+scrollTop的高度才能進行滾動 var lclone=$("#lscroll").html(); $("#lscrollout").append(lclone); var speed=1; var NY=window.setInterval(scroll2,100); function scroll2(){ var scrollTop=$(".scrollout").scrollTop()+speed; if(scrollTop==400){ scrollTop=0; } $(".scrollout").scrollTop(scrollTop); } $(".scrollout").hover(function(){clearInterval(NY)},function(){NY=setInterval(scroll2,100);}); </script> </head> <body> <div class="scrollout" id="rscrollout"> <div id="rscroll" class="scroll" style="height:400px;"> <ul> <li>1</li> <li>11</li> <li>111</li> <li>1111</li> <li>11111</li> <li>111111</li> <li>1111111</li> <li>11111111</li> <li>111111111</li> <li>1111111111</li> <li>11111111111</li> <li>111111111111</li> <li>1111111111111</li> <li>11111111111111</li> <li>111111111111111</li> </ul> </div> </div> </body> </html>