※ 文字浮現後消失 ※
|
<body text="#0000FF" background="jpg/01_bkg1.jpg"> <center> <script language="JavaScript1.2"> text=new Array('歡迎光臨動力資訊網','看到了嗎','夠酷吧','http://powerpc.24h.cc') color=new Array('#202020','#424242','#8E8E8E','#C2C2C2','#E8E8E8') //set the number of colors: var numColors=5 //set the size you want the zoom to end at: var endSize=30 //Set the speed you want it to zoom in (in milliseconds) var Zspeed=200 //Set the speed you want it too change colors in var Cspeed=200 //Set font var font='Arial Black,Arial,Helvetica' //do you want it to hide when its done? (true or false) var hide=true /*You can remove this if you don't wan't it to start right away. You can have it start if someone clicks a link (make a link like this: <a href="#" onclick="fadeInit()">Click to Zoomtext</a>)*/ onload=zoomInit; var size=10 var gonum=0 /*Browsercheck and settings vars ****************************************************************************/ var ie, n; if (document.all) { n=0 ie=1 zoomText='document.all.divZoom.innerText=text[num]' zoomSize='document.all.divZoom.style.fontSize=size' closeIt="" fadeColor="document.all.divZoom.style.color=color[num]" } if (document.layers) { n=1;ie=0 zoomText="" zoomSize="document.divZoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+size+'px; color:'+color[0]+'\">'+text[num]+'</p>')" closeIt="document.divZoom.document.close()" fadeColor="document.divZoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+endSize+'px; color:'+color[num]+'\">'+text[text.length-1]+'</p>')" } /*The functions for zooming text. ****************************************************************************/ function zoom(num,fn){ if (size<endSize){ eval(zoomText) eval(zoomSize) eval(closeIt) size+=5; setTimeout("zoom("+num+",'"+fn+"')",Zspeed) }else{ eval(fn); } } /*The functions for fading/changing colors on text ****************************************************************************/ function fadeIt(num){ if (num<numColors){ eval(fadeColor) eval(closeIt) num+=1; setTimeout("fadeIt("+num+")",Cspeed) }else{ hideIt() } } /*This is the function that hides the layer after the zoom/color change ****************************************************************************/ function hideIt(){ if(hide){ if(ie)document.all.divZoom.style.visibility="hidden" if(n)document.layers.divZoom.visibility="hidden" } } /*This is the functions that calls the right function...or something :} ****************************************************************************/ function zoomInit(){ if(ie){ //Added to make it center in ie5 document.all.divZoom.style.width=document.body.offsetWidth-50 document.all.divZoom.style.color=color[0] document.all.divZoom.style.fontFamily=font } if(ie || n) go(0) } function go(num){ gonum+=1 size=10 if(num<text.length){ zoom(num,'go('+gonum+')') }else{ fadeIt(0) } } function playAgain(){ size=10 gonum=0 if(ie) document.all.divZoom.style.visibility='visible' else if(n) document.layers.divZoom.visibility='visible' zoomInit() } //*************************************************************************** </script> </center> <div id="divZoom" align="center" style="position:absolute; left:0; top:70"></div> |