67、字符消失时加快

67、字符消失时加快

脚本说明:

把如下代码加入<head>区域中

<script language="JavaScript">

<!--

function scroll(seed)

{

var m1 = "欢迎你的光临"

var m2 = "请多提意见,可要记得长来呀,谢谢!"

var msg=m1+m2;

var out = " ";

var c = 1;

if (seed > 100) {

seed--;

var cmd="scroll(" + seed + ")";

timerTwo=window.setTimeout(cmd,60);

}

else if (seed <= 100 && seed > 0) {

for (c=0 ; c < seed ; c++) {

out+=" ";

}

out+=msg;

seed--;

var cmd="scroll(" + seed + ")";

window.status=out;

timerTwo=window.setTimeout(cmd,60);

} else if (seed <= 0) {

if (-seed < msg.length) {

out+=msg.substring(-seed,msg.length);

seed--;

var cmd="scroll(" + seed + ")";

window.status=out;

timerTwo=window.setTimeout(cmd,60);

}

else {

window.status=" ";

timerTwo=window.setTimeout("scroll(40)",60);

}

}

}

timerONE=window.setTimeout('scroll(40)',60);

//-->

</script>

 

 

Write a comment

Comments: 0