<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Document</title> <style> *{ padding: 0; margin: 0; } #moocBox{ height: 270px; width:200px; background: #eee; margin:0 auto; overflow: hidden; } ul li{ list-style: none; height: 30px; line-height: 30px; } #u{ margin-left: 25px; } </style></head><body> <div id="moocBox"> <ul id="u"> <li>1sdfwergsydgertyh</li> <li>2sdfwergertyertye</li> <li>3sdfwergsfgsdrtytr</li> <li>4sdfwergesrgydfgwetw</li> <li>5sdfwergwertdfgwer</li> <li>6sdfwergsertwertqw3t</li> <li>7sdfwergsertwrtdfgs</li> <li>8sdfwergsertwerysdfg</li> <li>9sdfwergserywertwert</li> </ul> </div><script type="text/javascript">var area=document.getElementById("moocBox"),i=24;area.innerHTML+=area.innerHTML;araea.scrollTop=0;function scrollUp(){ area.scrollTop++; if(area.scrollTop%i==0){ clearInterval(time); }}var time=setInterval("scrollUp()",50);</script></body></html>
添加回答
举报
0/150
提交
取消