完整的HTML代码如下:
<!--要把如下代码加入到<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]="欢迎光临e-show.com.cn!"
action[1]="这里是e-show.com.cn!"
action[2]="e-show.com.cn是你们的朋友!"
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>
|