<head>
<title>网页特效|Linkweb.cn/Js|---文字逐渐变换颜色</title>
</head><body>
<!--将以下代码加入HTML的<Body></Body>之间-->
<SCRIPT language=JavaScript>
<!-- Begin
text = "网页特效梦工厂"
color1 = "0000FF";
color2 = "FF0000";
fontsize = "4";
speed = 100;
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 changeCharColor() {
if (navigator.appName == "Netscape") {
document.a.document.write("<center><font face=arial size =" + fontsize + "><font color=" + color1 +
">");
for (var j = 0; j < text.length; j++) {
if(j == i) {
document.a.document.write("<font face=arial color=" + color2 + ">" + Text.charAt(i) + "</font>");
}
else {
document.a.document.write(text.charAt(j));
}
}
document.a.document.write('</font></font></center>');
document.a.document.close();
}
if (navigator.appName == "Microsoft Internet Explorer") {
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(i) + "</font>";
}
else {
str += text.charAt(j);
}
}
str += "</font></font></center>";
a.innerHTML = str;
}
(i == text.length) ? i=0 : i++;
}
setInterval("changeCharColor()", speed);
// End -->
</SCRIPT>
</body></html>
文字逐渐变换颜色
发布时间:2015-05-12 来源:查字典编辑
摘要:网页特效|Linkweb.cn/Js|---文字逐渐变换颜色
<html>
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
- nddeagnt.exe - nddeagnt是什么进程 有什么用
- msxct.exe - msxct是什么进程 有什么用
- mwd.exe - mwd是什么进程 有什么用
- nero.exe - nero是什么进程 有什么用
- musirc4.71.exe - musirc4是什么进程文件 有什么作用
- naimag32.exe - naimag32是什么进程 有什么用
- nalntsrv.exe - nalntsrv是什么进程 有什么用
- mxtask.exe - mxtask是什么进程文件 有什么用
- mysqld-nt.exe - mysqld-nt是什么进程 有什么用
- Photoshop打造漂亮的蓝色斜面玻璃字
热门脚本HTML教程学习