<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>字体闪烁</title>
</head>
<body>
<SCRIPT language=JavaScript>
<!--
text = "我叫刘丹,目前在上海某家公司从事.NET开发工作!希望以后能够在软件这个行业发挥自己的优势,吸取教训,不断提升自己,能够在这个行业开拓一片属于自己的天空!"; //修改显示内容
color1 = "#FFCCCC"; //文字的颜色
color2 = "#00BBCC"; //转换的颜色,如果此处用WHITE会有另一种不同的效果,
fontsize = "36pt"; //字体大小
speed = 300; //转换速度 (1000 = 1 秒)
i = 0;
if (navigator.appName == "Netscape") {
document.write("<layer id=x visibility=show></layer><br><br><br>");
}
else {
document.write("<div id=x></div>");
}
function changeCharColor() {
if (navigator.appName == "Netscape") {
document.x.document.write("<center><font face=arial ><font color=" + color1 +
">");
for (var j = 0; j < text.length; j++) {
if(j == i) {
document.x.document.write("<font face=arial color=" + color2 + ">" + Text.charAt(i) + "</font>");
}
else {
document.x.document.write(text.charAt(j));
}
}
document.x.document.write('</font></font></center>');
document.x.document.close();
}
if (navigator.appName == "Microsoft Internet Explorer") {
str = "<font face=arial><font color=" + color1 + ">";
for (var j = 0; j < text.length; j++) {
if( j == i) {
str += "<font face=arial color=" + color2 + ">" + text.charAt(i) + "</font>";
}
else {
str += text.charAt(j);
}
}
str += "</font></font>";
x.innerHTML = str;
}
(i == text.length) ? i=0 : i++;
}
setInterval("changeCharColor()", speed);
-->
</SCRIPT></body>
</html>