文字的荧光灯效果

<script language="JavaScript1.2" class="css2">
/*
Neon Lights Text
By Website Abstraction (http://wsabstract.com)//原效果来自
Over 400+ free scripts here!
*/
//下面设置显示效果的属性
var message="欢迎光临七色风网页家园!"
var neonbasecolor="black"
var neontextcolor="red"
var flashspeed=100  //in milliseconds


var n=0
if (document.all){
document.write('<font color="'+neonbasecolor+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight">'+message.charAt(m)+'</span>')
document.write('</font>')

//cache reference to neonlight array
var tempref=document.all.neonlight
}
else
document.write(message)

function neon(){

//Change all letters to base color
if (n==0){
for (m=0;m<message.length;m++)
tempref[m].style.color=neonbasecolor
}

//cycle through and change individual letters to neon color
tempref[n].style.color=neontextcolor

if (n<tempref.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",1500)
return
}
}

function beginneon(){
if (document.all)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>

posted @ 2007-10-26 00:48  wj-conquer  阅读(253)  评论(0编辑  收藏  举报