像歌词跟着声音走的JS文字效果

时间:2014-08-12 12:51:44   收藏:0   阅读:346
<html>
<head>
<title>石家庄花卉</title>
</head>
<body>
<script language="JavaScript">
var message="像歌词显示一样JS文字效果!"
var neonbasecolor="gray"
var neontextcolor="blue"
var flashspeed=100
var n=0
if (document.all){
document.write(<font size="3" color="+neonbasecolor+">)
for (m=0;m<message.length;m++)
document.write(<span id="neonlight">+message.charAt(m)+</span>)
document.write(‘‘)
var tempref=document.all.neonlight
}
else
document.write(message)
function neon(){
if (n==0){
for (m=0;m<message.length;m++)
tempref[m].style.color=neonbasecolor
}
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>
</body>
</html>

 

像歌词跟着声音走的JS文字效果,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!