在状态栏显示滚动文字:
<script LANGUAGE="JavaScript">
<!--
var scrl_timer_active = false; //标记当前是否活动中
var scrl_timer_id = null; //timer对象
var my_message = "欢迎光临中远网络! "; //设置消息内容
var scrl_status_size = 200; //设置显示范围
var scrl_speed = 1; //设置步伐大小
var scrl_time = 60; //设置步伐速度
var scrl_msg = ""; //循环消息的内容
var scrl_idx = 0; //显示消息的首位置,即从哪个位置开始显示
var scrl_wrap = 100; //消息长度
function scroll_start(size, spd, time, msg) {
scroll_stop();
scrl_status_size = size;
scrl_speed = spd;
scrl_time = time;
scrl_wrap = msg.length;
diff = (size/msg.length)+1;
for(x=0; x<diff; x++)
scrl_msg += msg + " ";
scroll_status();
scrl_timer_active = true;
}
function scroll_stop() {
if(scrl_timer_active)
window.clearTimeout(scrl_timer_id);
scrl_timer_active = false;
}
function scroll_status() {
window.status = scrl_msg.substring(scrl_idx, scrl_idx+scrl_status_size);
scrl_idx += scrl_speed;
if(scrl_idx >= scrl_wrap)
scrl_idx -= scrl_wrap;
scrl_timer_id = window.setTimeout("scroll_status()",scrl_time);
}
//-->
</script>
<body ONLOAD="scroll_start(73, 0.1, 50, my_message)" OnUnload="scroll_stop()">