代码如下
不过好像只有在Internet Explorer下才有效果
<html>
<head>
<title>状态栏跑马灯</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<script>
<!--
function scrollit(seed) {
var m1 = "你想说的话1 ";
var m2 = "你想说的话2 ";
var m3 = "你想说的话3 ";
var m4 = "你想说的话4 ";
var m5 = "你想说的话5 ";
var msg=m1+m2+m3+m4+m5;
var out = " ";
var c = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
//-->
</script>
</head>
<body onLoad="scrollit(100)">
</body>
</html>