178、逐字出现的信息条

178、逐字出现的信息条

脚本说明:

第一步:把如下代码加入<body>区域中

<script language="JavaScript">

 

 

function makeArray() {

 

                                this.length = makeArray.arguments.length

 

                                for (var i = 0; i < this.length; i++)

 

                                this[i+1] = makeArray.arguments[i]

 

                          }

 

                          var fArray = new makeArray;

 

                          fArray[0]="Message 1 goes here. ";

 

                          fArray[1]="Message 2 goes here.  "

 

                          fArray[2]="Message 3 goes here. "

 

                          fArray[3]="Message 4 goes here. "

 

 

 

                          var x = 1;

 

                          var y = 0;

 

                          var msg1 = fArray[y];

 

 

 

                          function newsFeed() {

 

                             if (x==msg1.length+1) {

 

                                for (var z=0; z < 70000; z++);

 

                                y+=1;

 

                                if (y > 3) y=0;

 

                                document.form1.news2.value=' ';

 

                                msg1 = fArray[y];

 

                                x=0;

 

                             }

 

                             document.form1.news2.value=msg1.substring(0,x); 

 

                             x+=1;

 

                             setTimeout("newsFeed() ",100);

 

                          }

 

 

</script>

<form name="form1">

<textarea wrap=physical rows=10 cols=25 name="news2">

</textarea>

</form>

 

 

 

 

第二步:把如下代码加入<body>区域中

<body bgcolor="#fef4d9" onLoad="newsFeed()">

 

Write a comment

Comments: 0