글자에 네온효과를 부여합니다.. 데모를 눌러 확인하세요



Script Example
<h2>
<script language="JavaScript1.2">
var message="Homepage Bible"
var neonbasecolor="gray"
var neontextcolor="yellow"
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>
</h2>


스크립트를 body 태그 안 원하는 위치에 삽입하세요.

글자내용과 변할때의 색은 소스중 빨간색부분에서 수정하시면 됩니다.