升降的文字效果

 

点击这里看效果


在 <body> 与 </body> 之间加入:

<SCRIPT language=JavaScript>
done = 0;
step = 4
function anim(yp,yk)
{
if(document.layers) document.layers["napis"].top=yp;
else document.all["napis"].style.top=yp;

if(yp>yk) step = -4
if(yp<60) step = 4
setTimeout('anim('+(yp+step)+','+yk+')', 35);
}
function start()
{
if(done) return
done = 1;
if(navigator.appName=="Netscape") {
document.napis.left=innerWidth/2 - 145;
anim(60,innerHeight - 60)
}
else {
napis.style.left=11;
anim(60,document.body.offsetHeight - 60)
}

}
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript>
setTimeout('start()',10);
</SCRIPT>

<DIV id=napis style="FONT-SIZE: 20pt; COLOR: #000000; FONT-FAMILY:
宋体; POSITION: absolute; TOP: 22px; left: 14px; width: 244px; height: 27px">
<P>欢迎光临一迪网络!</P></DIV>