由下往上无间隙滚动文字
由上往下无间隙滚动文字
由上往下无间隙滚动文字 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> </head> <body> <DIV id="scrollobj" style="white-space:nowrap;overflow:hidden; height:50px;"><span>这里是要滚动的内容</span> </DIV> <script language="javascript" type="text/javascript"> <!-- function scroll(obj) { var tmp = (obj.scrollTop)++; //当滚动到达顶端时 if (obj.scrollTop==tmp) obj.innerHTML +=obj.innerHTML; //当滚动到初始内容的高度时,回到最顶端 if (obj.scrollTop>=obj.firstChild.offsetHeight) obj.scrollTop=0; } setInterval("scroll(document.getElementById('scrollobj'))",20); //--> </script> </body> </html>