75、状态栏特效2

75、状态栏特效2

脚本说明:

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

<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]="闺中少妇不之愁,春日凝妆上翠楼,忽见陌头杨柳色,悔教夫婿觅封侯!"

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