不错的文字特效,逐字变色效果
2007-04-16 00:00
411 查看
<font color="#669900" style="font-weight:bolder;letter-spacing: 2px;"><script language="JavaScript">
text = "www.jb51.net";
color1 = "green";
color2 = "red";
speed = 200;
i = 0;
if (navigator.appName == "Netscape") {
}
else {
document.write("<span id=a></span>");
}
function changeCharColor() {
if (navigator.appName == "Netscape") {
document.a.document.write("<font color=" + color1 + ">");
for (var j = 0; j < text.length; j++) {
if(j == i) {
document.a.document.write("<font color=" + color2 + ">" + Text.charAt(i) + "</font>");
}
else {
document.a.document.write(text.charAt(j));
}
}
document.a.document.write('</font>');
document.a.document.close();
}
if (navigator.appName == "Microsoft Internet Explorer") {
str = "<font color=" + color1 + ">";
for (var j = 0; j < text.length; j++) {
if( j == i) {
str += "<font color=" + color2 + ">" + text.charAt(i) + "</font>";
}
else {
str += text.charAt(j);
}
}
str += "</font>";
a.innerHTML = str;
}
(i == text.length) ? i=0 : i++;
}
setInterval("changeCharColor()", speed);
// End -->
</script>
</font>
运行效果
"); } else { document.a.document.write(text.charAt(j)); } } document.a.document.write(''); document.a.document.close(); } if (navigator.appName == "Microsoft Internet Explorer") { str = ""; for (var j = 0; j " + text.charAt(i) + ""; } else { str += text.charAt(j); } } str += ""; a.innerHTML = str; } (i == text.length) ? i=0 : i++; } setInterval("changeCharColor()", speed); // End -->
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
text = "www.jb51.net";
color1 = "green";
color2 = "red";
speed = 200;
i = 0;
if (navigator.appName == "Netscape") {
}
else {
document.write("<span id=a></span>");
}
function changeCharColor() {
if (navigator.appName == "Netscape") {
document.a.document.write("<font color=" + color1 + ">");
for (var j = 0; j < text.length; j++) {
if(j == i) {
document.a.document.write("<font color=" + color2 + ">" + Text.charAt(i) + "</font>");
}
else {
document.a.document.write(text.charAt(j));
}
}
document.a.document.write('</font>');
document.a.document.close();
}
if (navigator.appName == "Microsoft Internet Explorer") {
str = "<font color=" + color1 + ">";
for (var j = 0; j < text.length; j++) {
if( j == i) {
str += "<font color=" + color2 + ">" + text.charAt(i) + "</font>";
}
else {
str += text.charAt(j);
}
}
str += "</font>";
a.innerHTML = str;
}
(i == text.length) ? i=0 : i++;
}
setInterval("changeCharColor()", speed);
// End -->
</script>
</font>
运行效果
"); } else { document.a.document.write(text.charAt(j)); } } document.a.document.write(''); document.a.document.close(); } if (navigator.appName == "Microsoft Internet Explorer") { str = ""; for (var j = 0; j " + text.charAt(i) + ""; } else { str += text.charAt(j); } } str += ""; a.innerHTML = str; } (i == text.length) ? i=0 : i++; } setInterval("changeCharColor()", speed); // End -->
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
相关文章推荐
- 不错的文字特效,逐字变色效果
- js文字特效制作js文字闪烁与文字变色效果
- [css特效]A标记的经典效果:鼠标放到A的整行上,背景变色(鼠标没在文字上)
- 精彩的变色文字特效
- 简单做出HTML5翻页效果文字特效
- 用纯css3实现的图片放大镜特效效果非常不错
- 打字效果的文字特效
- Photoshop文字特效——火球立体效果文字
- Photoshop文字特效——牛仔布纹理效果文字
- 一个不错的渐隐文字效果第1/2页
- Qt实现卡拉OK文字逐渐变色效果
- 文字轮显效果特效
- Photoshop文字特效——栅格层叠效果文字
- android自定义view仿今日头条加载文字变色效果
- html+css选项卡tab形式的用户注册特效,效果不错
- 【js特效】一款不错的漂浮悬浮效果
- 一个不错的渐隐文字效果第1/2页
- javascript 打字效果的文字特效
- 网页特效、Javascript代码,包括跑马灯、打字插效、不停变色的文字
- 逐个变色的CSS文字效果