<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>
相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
- ■4G版索尼Xperia Z2什么时候发售 索尼Xperia Z2预售时间
- ■nubia x6分屏功能在哪里?怎么用?努比亚x6分屏功能开启使用方法
- ■nubia x6和小米2s区别对比是什么?哪个好?
- ■华为荣耀3X畅玩版开发者选项在哪里 如何设置
- ■Nubia X6配置怎么样?Nubia X6手机有几个版本以及Nubia X6价格是多少?
- ■努比亚x6支持电信吗?努比亚nubia x6能用电信卡吗?
- ■htc one m8价格多少?all new htc one m8价格、时间、配置曝光
- ■三星N9006怎样禁用应用程序 三星N9006实用小技巧
- ■魅族mx2延保半年活动网址和介绍
- ■oppo智能手机怎么样?oppo值得购买的手机有哪些
热门脚本HTML教程学习
网页设计子分类