26、间隔状态栏跑马灯

26、间隔状态栏跑马灯

脚本说明:

第一步:把如下代码加入<head>区域中

<SCRIPT language="JavaScript">

<!--

function scrollit(seed) {

var m1 = "HI:你 !             ";

var m2 = " 访         ";

var m3 = " 见,谢 !          ";

var m4 = "我们的音乐网站:http://www.7stk.com      ";

var m5 = "http://www.7stk.com         ";

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>

 

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

<body background=bag.gif onLoad="scrollit(100)">

 

 

Write a comment

Comments: 0