下面代码插入到<head>与</head>之间
<SCRIPT>
messages = new Array()
messages[0] = "这个js够酷吧"
messages[1] = "它绝对能吸引访问者的注意力"
messages[2] = "且并不增加多少下载时间"
messages[3] = "但可惜的是,"
messages[4] = "Netscape Navigator不太支持这个。"
mescolor = new Array()
mescolor[0] = "000000"
mescolor[1] = "FF0000"
mescolor[2] = "008800"
mescolor[3] = "0000FF"
mescolor[4] = "888800"
messize = new Array()
messize[0] = "30pt"
messize[1] = "30pt"
messize[2] = "30pt"
messize[3] = "30pt"
messize[4] = "30pt"
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]+";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>语句中:
onload=dotransition()
下面代码插入到<body>与</body>之间你需要的位置:
<DIV id=content
style="FILTER: revealTrans(Transition=12, Duration=2); HEIGHT:
200px; LEFT: 93px; POSITION: absolute; TEXT-ALIGN: center; TOP:
21px; WIDTH: 559px"></DIV>
<DIV id=source
style="COLOR: #aaaaaa; LEFT: 94px; POSITION: absolute; TEXT-ALIGN:
center; TOP: 243px; WIDTH: 560px">
|