<HTML>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
dsp_str = "JavaScript&Tips";
clr1 = "blue";
clr2 = "gold";
fontsize = "8";
speed = 200;
i = 0;
if (navigator.appName == "Netscape") {
document.write("<layer id=a visibility=show></layer><br><br><br>");
}
else {
document.write("<div id=a></div>");
}
function swap_chr_color() {
if (navigator.appName == "Netscape") {
document.a.document.write("<center><font size =" + fontsize + "><font color=" + clr1 + ">");
for (var j = 0; j < dsp_str.length; j++) {
if(j == i) {
document.a.document.write("<font color=" + clr2 + ">" + dsp_str.charAt(i) + "</font>");
}
else {
document.a.document.write(dsp_str.charAt(j));
}
}
document.a.document.write('</font></font></center>');
document.a.document.close();
}
if (navigator.appName == "Microsoft Internet Explorer") {
str = "<center><font size=" + fontsize + "><font color=" + clr1 + ">";
for (var j = 0; j < dsp_str.length; j++) {
if( j == i) {
str += "<font color=" + clr2 + ">" + dsp_str.charAt(i) + "</font>";
}
else {
str += dsp_str.charAt(j);
}
}
str += "</font></font></center>";
a.innerHTML = str;
}
(i == dsp_str.length) ? i=0 : i++;
}
setInterval("swap_chr_color()", speed);
//-->
</SCRIPT>
</BODY>
</HTML>
|