源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

不错的文字特效,逐字变色效果

  • 时间:2022-03-14 15:11 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:不错的文字特效,逐字变色效果
<font color="#669900" style="font-weight:bolder;letter-spacing: 2px;"><script language="JavaScript"> text = "www.1sucai.cn"; 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>   运行效果
[Ctrl+A 全选 注:[url=http://www.1sucai.cn/article/23421.htm]如需引入外部Js需刷新才能执行[/url]]
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部