主题:一个跑马灯问题
<html>
<head>
<script language="javascript"><!--Hide
var scrtxt="欢迎你"+"Here goes your message tfe visitor to your page";
var lentxt=scrtxt.length;
var weight=100;
var pos=1-weight;
funtion scoll(){
pos++;
var scoller="";
if (pos=lentxt){pos=1-weight;}
if(pos<0){
for(var i=1;i<=Math.abs(pos);i++)
{scoller=scoller+"";}
scoller=scoller+srctxt.substring(0,weight-i+1);
}
else
{
scoller=scoller+srctxt.substring(pos,weight+pos);
}
window.status+scoller;
setTimeout("scoll()",150);
}//-->
</script>
<title>无标题文档</title>
</head>
<body onLoad="scoll();return true;">这里显示你的网页!
</body>
</html>
希望大家讲解,多谢!
<head>
<script language="javascript"><!--Hide
var scrtxt="欢迎你"+"Here goes your message tfe visitor to your page";
var lentxt=scrtxt.length;
var weight=100;
var pos=1-weight;
funtion scoll(){
pos++;
var scoller="";
if (pos=lentxt){pos=1-weight;}
if(pos<0){
for(var i=1;i<=Math.abs(pos);i++)
{scoller=scoller+"";}
scoller=scoller+srctxt.substring(0,weight-i+1);
}
else
{
scoller=scoller+srctxt.substring(pos,weight+pos);
}
window.status+scoller;
setTimeout("scoll()",150);
}//-->
</script>
<title>无标题文档</title>
</head>
<body onLoad="scoll();return true;">这里显示你的网页!
</body>
</html>
希望大家讲解,多谢!