- 有停顿的JS文字滚动,无缝循环的文字滚动,也就是可以无限制的循环指定的一段文字,简洁实用的网页特效,期待收藏。
点击(此处)折叠或打开
- <html>
- <head>
- <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
- <title>间断滚动</title>
- <style>
- #Marquee{ height:90px; overflow:hidden;}
- #Marquee div{ border:1px solid #DDD3FE; background:#EEECF4; height:88px;}
- </style>
- </head>
- <body>
- <div id=\"Marquee\">
- <div style=\"width: 260px; height: 88px\">
- <Font Size=3 Face=\"楷体_GB2312\">
- 横向的数据全部显示的时候就由上往下竖着排列由左向右滚动了,偶需要一条信息一条信息的出,要么就是由下向上,一条一条的出,出现的时候停顿一下。 </Font>
- </div>
- </div>
- <script>
- var Mar = document.getElementById(\"Marquee\");
- var child_div=Mar.getElementsByTagName(\"div\")
- var picH = 90;//移动高度
- var scrollstep=3;//移动步幅,越大越快
- var scrolltime=20;//移动频度(毫秒)越大越慢
- var stoptime=3000;//间断时间(毫秒)
- var tmpH = 0;
- Mar.innerHTML += Mar.innerHTML;
- function start(){
- if(tmpH < picH){
- tmpH += scrollstep;
- if(tmpH > picH )tmpH = picH ;
- Mar.scrollTop = tmpH;
- setTimeout(start,scrolltime);
- }else{
- tmpH = 0;
- Mar.appendChild(child_div[0]);
- Mar.scrollTop = 0;
- setTimeout(start,stoptime);
- }
- }
- onload=function(){setTimeout(start,stoptime)};
- </script></body>
- </html>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29737856/viewspace-1243575/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29737856/viewspace-1243575/