<html>
<head>
<title>逐字变化文字颜色 js代码下载</title>
<script language="javascript">
<!--
text = "小猪站长学院JS代码下载";
i=0;
function chColor(){
colorStr = text.charAt(i);
colorStr = "<font color = red>" + colorStr + "</font>";
leftStr = text.substr(0,i);
rightStr = text.substr(i+1,text.length-i);
txt.innerHTML = leftStr + colorStr + rightStr;
i++;
if (i>=text.length)i=0;
setTimeout("chColor()",500);
}
//-->
</script>
</head>
<body onLoad="chColor()">
<div id="txt"></div>
</body>
</html>