跑马灯

  

 1 <html>
 2 <head>
 3     <meta charset="utf-8">
 4 <script language="JavaScript">
 5 <!-- Hide
 6 var scrtxt="怎麽样 ! 很酷吧 ! 您也可以试试."+"Here goes your message the visitors to your
 7 page will "+"look at for hours in pure fascination...";
 8 var lentxt=scrtxt.length;
 9 var width=100;
10 var pos=1-width;
11 function scroll() {
12 pos++;
13 var scroller="";
14 if (pos==lentxt) {
15 pos=1-width;
16 }
17 if (pos<0) {
18 for (var i=1; i<=Math.abs(pos); i++) {
19 scroller=scroller+" ";}
20 scroller=scroller+scrtxt.substring(0,width-i+1);
21 }
22 else {
23 scroller=scroller+scrtxt.substring(pos,width+pos);
24 }
25 window.status = scroller;
26 setTimeout("scroll()",150);
27 }
28 //-->
29 </script>
30 </head>
31 <body onLoad="scroll();return true;">
32 这里可显示您的网页 !
33 </body>
34 </html>
---- 动动手指关注我!或许下次你又能在我这里找到你需要的答案!ZZZZW与你一起学习,一起进步!
原文地址:https://www.cnblogs.com/zzzzw/p/4878424.html