网站首页
高清电影
无损音乐
游戏攻略
电脑教程
破解资源
站长资源
软件下载
不错的文字特效,逐字变色效果
(编辑:jimmy 日期: 2024/10/14 浏览:
2
)
<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>
运行效果
[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
上一篇:
javascript下用键盘控制层的移动的代码
下一篇:
一个已封装好的漂亮进度条
最新资源
白嘉倩.1992-我有我【星工厂】【WAV+CUE】
黎明.2006-LOOKING【东亚唱片】【WAV+CUE】
群星.1986-国语金曲尽精英【瑞成】【WAV+CUE】
長渕剛《Blood》[FLAC/分轨][299.09MB]
群星《歌手2024 第4期》[320K/MP3][107.39MB]
群星《歌手2024 第4期》[FLAC/分轨][563.76MB]
RiffKitten-ChaosParade(2024)[24-44,1]FLAC
RuneKlakegg-Nattevandrer(2024)[24-96]\FLAC
赖冰霞.2006-金嗓典藏辑2IN1(南方金点系列)2CD【
群星.1988-国语金曲尽精英VOL.2【瑞成】【WAV+C
首页
音乐
电影
资源