JS 字符慢慢隱現

字符慢慢隱現 把下列代碼加入網頁即可:
<body bgcolor="#FFFFFF" id="catuds">
<div id="catuds1" style="visibility:visible;width:400px;height:30px;text-align:center; font-family:隸書;font-size:30pt;color:6699ff"></div>
<SCRIPT language="JavaScript">
<!--
var thissize=20
var textfont="隸書"

var textcolor= new Array()
textcolor[0]="000000"
textcolor[1]="000000"
textcolor[2]="000000"
textcolor[3]="111111"
textcolor[4]="222222"
textcolor[5]="333333"
textcolor[6]="444444"
textcolor[7]="555555"
textcolor[8]="666666"
textcolor[9]="777777"
textcolor[10]="888888"
textcolor[11]="999999"
textcolor[12]="aaaaaa"
textcolor[13]="bbbbbb"
textcolor[14]="cccccc"
textcolor[15]="dddddd"
textcolor[16]="eeeeee"
textcolor[17]="ffffff"
textcolor[18]="ffffff"

var message = new Array()
message[0]="歡迎小巧工作室"
message[1]="多停留一會兒"
message[2]="你會有更多的收穫"
message[3]="請再次光臨"
i_message=0

var i_strength=0
var i_message=0
var timer

function catuds() {
if(document.all) {
if (i_strength <=17) {
catuds1.innerText=message[i_message]
document.all.catuds1.style.filter="glow(color="+textcolor[i_strength]+", strength=4)"
i_strength++
timer=setTimeout("catuds()",100)
}
else {
clearTimeout(timer)
setTimeout("catuds()",1500)
}
}
}

function decatuds() {
if(document.all) {
if (i_strength >=0) {
catuds1.innerText=message[i_message]
document.all.catuds1.style.filter="glow(color="+textcolor[i_strength]+", strength=4)"
i_strength--
timer=setTimeout("decatuds()",100)
}
else {
clearTimeout(timer)
i_message++
if (i_message>=message.length) {i_message=0}
i_strength=0
intermezzo()
}
}
}

function intermezzo() {
helpor_net.innerText=""
setTimeout("catuds()",1000)
}
catuds();
//-->
</SCRIPT> 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章