极酷的文字特效
将以下代码复制到<head> </head>之间:
<SCRIPT>
messages = new Array()
messages[0] = "HELLO"
messages[1] = "welcome"
messages[2] = "Multimedia"
messages[3] = "Internet"
messages[4] = "JavaScript"
mescolor = new Array()
mescolor[0] = "000000"
mescolor[1] = "FF0000"
mescolor[2] = "008800"
mescolor[3] = "#ff9900"
mescolor[4] = "888800"
messize = new Array()
messize[0] = "15pt"
messize[1] = "20pt"
messize[2] = "30pt"
messize[3] = "40pt"
messize[4] = "45pt"
var i_messages = 0
var timer
function dotransition() {
if (document.all) {
content.filters[0].apply()
content.innerHTML = "<span style='color:"+mescolor[i_messages]+";font-size:"+messize[i_messages]+";font-family:"+'Arial
black'+";filter: revealTrans(Transition=12, Duration=3)'>"+messages[i_messages]+"</span>"
content.filters[0].play()
if (i_messages >= messages.length-1) {
i_messages = 0
}
else {
i_messages++
}
}
if (document.layers) {
document.content.document.write("<span style='color:"+mescolor[i_messages]+"'>"+messages[i_messages]+"</span>")
if (i_messages >= messages.length-1) {
i_messages = 0
}
else {
i_messages++
}
}
timer = setTimeout("dotransition()",5000)
}
</SCRIPT>
将<body>语句变为<body onload=dotransition()>
将以下代码加到<body></body>之间:
<DIV id=content style="FILTER: revealTrans(Transition=12,
Duration=2); HEIGHT: 150px; LEFT: 150px; POSITION: absolute;
TEXT-ALIGN: center; TOP: 21px; WIDTH: 559px"></DIV>
|