45、单个字出现后再整句

45、单个字出现后再整句

<!-- 要实现此效果需要 1 个步骤: -->

 

<!-- 1 步: -->

<!-- 把下面的代码加到<HEAD></HEAD>区域中: -->

 

<script language="JavaScript">

<!--

var current = 0

var x = 0

var speed = 200

var speed2 = 5000

 

function initArray(n) {

this.length = n;

for (var i =1; i <= n; i++) {

this[i] = ' '

}

}

 

action = new initArray(4)

action[0]="欢迎光临!"

action[1]="这里是www.pkvs.com!"

action[2]="你所关注的就是我们所关注的!"

action[3]="再次感谢你的光临!"

 

function action2() {

var m = action[current]

 

window.status = m.charAt(x++)

 

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

x = 0

current++

window.status = m

 

if (current > action.length - 1) {

current = 0

}

 

setTimeout("action2()", speed2)

}

 

else {

setTimeout("action2()", speed)

}

}

 

action2()

//-->

</script

Write a comment

Comments: 0