187、文字逐个出现

187、文字逐个出现

脚本说明:

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

<script lanuage="JavaScript">

 

var count = -1;

var counter;

var nchar

var speedtogo = 200

 

var a = new Array();

 

a[1] = "网页特效欢迎你的光临";

a[2] = "";

 

 

function capswitch() {

 count++

 if(count == 0){

   document.wow.display.value = a[1]

  }

 if(count == 1){

    document.wow.display.value = a[2].substring(0, 1) +

a[1].substring(20, 1)

        }

 if(count > 1){

   a[3] = a[1].substring(0, count - 1) + a[2].substring(count - 1,

count) + a[1].substring(20, count)

  document.wow.display.value = a[3]

 }

 if(count == a[1].length){

    count = -1

  }

 

         counter    = setTimeout("capswitch()",speedtogo);

 

 }

 

 

</script>

<form name="wow">

<input type="text" size="20" name="display" value="">

</form>

 

 

 

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

<body bgcolor="#fef4d9" onload="capswitch()"> 

 

Write a comment

Comments: 0