在网上看到的走马灯程序,请各位大虾赐教!
<SCRIPT language="JavaScript"><!--
function scrollit(seed) {
var m1 = "HI:你 好! ";
var m2 = "欢 迎 访 问 网 页 特 效 大 全 ";
var m3 = "请 多 提 意 见,谢 谢! ";
var m4 = "E-MAIL:xxxx@ ";
var m5 = "http:// ";
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>