<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
text = "WelcomeToMyPage";
color1 = "blue";
color2 = "red";
fontsize = "6";
speed = 100;
var i=0;
function changeColor()
{
str = "<center><font face=Arial size=" + fontsize + "><font color=" + color1 + ">";
for(var j=0; j < text.length ; j++)
{
if(j == i)
{
str += "<font face=Arial color=" + color2 + ">" + text.charAt(j) + "</font>";
}
else
{
str += text.charAt(j);
}
}
str += "</font></font></center>";
}
(i == text.length) ? i=0 : i++;
setInterval("changeColor()", speed);
</script>
<body>
</body>
</html>