滚动效果
程序代码:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <script type="text/javascript" language="javascript"> var i=1; function show() { if(Div3.offsetTop-Div1.scrollTop<=0) { Div1.scrollTop-=Div2.offsetHeight; } else { Div1.scrollTop++; } } var theTime=setInterval("show()",50); </script> </head> <body> <div id="Div1" style="overflow:hidden;width:383px;height:275px"> <div id="Div2" style="overflow:hidden;width:346px;height:117px"> <p>asdfasdfffffffffffffffffffffffffffff</p> <p>fffffffffffffffffffffffffffffffffffffffff</p> <p>fffffffffffffffffffffffffffffffffffffffffffffff</p> <p>fffffffffffffffffffffffffffffffffffffffffffff</p> </div> <div id="Div3" style="position:absolute;left:15px;top:153px;width:353px;height:105px"> <p>fffffffffffffffffffffffffffffffff</p> <p>sssssssssssssssssssssssssssssssssssss</p> <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p> <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p> </div> </div> </body> </html>不知道为什么只滚动一下就不走了!请大侠帮忙看看!