文字不间断无缝向上滚动代码
<!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" /> <meta name="keywords" content="站长,网页特效,js特效,广告代码,zzjs,zzjs.net,sky,,站长特效 网" /> <meta name="description" content=",站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网" /> <title>文字不间断向上滚动</title> <style> *{ margin:0; padding:0;} #scrolls{ float:left; width:300px; height:100px; overflow:hidden; font-size:12px;} #scrolls .indemo { float: left; width: 100%;} #scrolls p{ font-size:12px;} #demo1,#demo2 { float: left;} </style> </head> <body> <div id="scrolls"> <div class="indemo"> <div id="demo1"> <p> 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动!<br /> 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! 文字不间断向上滚动鼠标放上去就停止滚动! </p> </div> <div id="demo2"></div> </div> </div> <script> function ScrollsTop(mainid,speeds){ var speed=speeds; var tabTop=document.getElementById(mainid); var tab1=document.getElementById("demo1"); var tab2=document.getElementById("demo2"); tab2.innerHTML=tab1.innerHTML; function Marqueet(){ if(tabTop.scrollTop>=tab2.offsetHeight) tabTop.scrollTop-=tab1.offsetHeight; else{ tabTop.scrollTop++; } } var MyMar=setInterval(Marqueet,speed); tabTop.onmouseover=function() {clearInterval(MyMar)}; tabTop.onmouseout=function() {MyMar=setInterval(Marqueet,speed)}; }
ScrollsTop('scrolls',20); </script> </body> </html>
辛苦整理@转载请注明:http://www.esw.net.cn/shownews.asp?id=292
更多关于网站建设推荐阅读:
文字向上滚动代码
js鼠标滑过切换层效果代码在IE、FireFox下测试通过
鼠标滑过DIV切换代码
|