|
马上注册,结交更多郧西好友
您需要 登录 才可以下载或查看,没有帐号?注册
x
渐显效果的文字是这样的一种动画效果:文字的颜色在浅显与深厚之间相互逐渐交换,然后不断地循环,简中还可以将文字转换。这样给人以一种若有若无的视觉效果,颇受网页制作与浏览者的喜爱。下面我们就来实现这一效果:
首先启动FrontPage2000,接着点击左下角的“HTML”标签进入HTML编辑状态。然后把HTML编辑状态下已经有的<body>代码改写成为<body bgcolor="#fef4d9" onLoad="glowtext()">。
然后在<body>与</boyd>区域之间加入下面一段代码:
<div id="glowdiv" style="position:absolute;visibility:visible;width:600px;text-align:center; top:185px;left:70px;font-family:宋体;font-size:30pt;color:000000"></div>
接着再把下面一段代码加入<head>与</head>区域之中,然后点击“预览”标签即可观看到交字渐显的效果了。
<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]="效果不断循环"
imessage=0
var istrength=0
var imessage=0
var timer
function glowtext() {
if(documentall) {
if (istrength <=17) {
glowdivinnerText=message[imessage]
documentallglowdivstylefilter="glow(color="+textcolor[istrength]+", strength=4)"
istrength++
timer=setTimeout("glowtext()",100)
}
else {
clearTimeout(timer)
setTimeout("deglowtext()",1500)
}}}
function deglowtext() {
if(documentall) {
if (istrength >=0) {
glowdivinnerText=message[imessage]
documentallglowdivstylefilter="glow(color="+textcolor[istrength]+", strength=4)"
istrength--
timer=setTimeout("deglowtext()",100)
}
else {
clearTimeout(timer)
imessage++
if (imessage>=messagelength) {imessage=0}
istrength=0
intermezzo()
}}}
function intermezzo() {
glowdivinnerText=""
setTimeout("glowtext()",1000)
}
//-->
</SCRIPT> |
|