javascript状态栏文字首尾相接循环滚动

来源:互联网 发布:湘北vs山王 数据 编辑:程序博客网 时间:2024/05/21 07:36
<html><head><title>中国风</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script language="JavaScript"><!--hidevar message="^_^欢迎光临本站!";var position = 0;var sta="";var x=2*(60/message.length);for(i=0;i<x;i++){sta+=message;}function statusScroll(){window.status=sta.substring(position,position+60);if(position++==60)position=0;}--hide--></script></head><body><script language="JavaScript">setInterval("statusScroll()",150);// 使用setInterval()按时间间隔调用函数</script></body></html>