close
語法說明:
1.在 message = "歡迎光臨 本站網址 http://ns-girl.myweb.hinet.net/"; 中修改文字的內容(假如要換句,以空格隔開)
2.在 colours = new Array('#FF0000','#0000FF','#FF00FF') 循環輪替的顏色
3.在 timer = setTimeout("wenchin()",50) 中修改文字顯示的速度
<!--迎面而來的文字_開始--> <script language="JavaScript"> <!-- <!--在此修改文字的內容(假如要換句,以空格隔開)--> message = "歡迎光臨 本站網址 http://ns-girl.myweb.hinet.net/"; <!--在此修改循環輪替的顏色--> colours = new Array('#FF0000','#0000FF','#FF00FF') siZe = 5; message = message.split(' '); timer = null; clrPos = 0; msgPos = 0; jog = 1; currentStep = 10; step = 8; ns = (document.layers)?1:0; viz = (document.layers)?'hide':'hidden'; if (ns) document.write("<div id='T' style='position:absolute'></div><br>"); else { document.write("<div style='position:absolute'>"); document.write("<div align='center' style='position:relative'>"); document.write("<div id='T' style='position:absolute;width:0;height:0;font-family:Arial;font-size:0'>kurt</div>"); document.write("</div></div><br>"); } function wenchin() { var pageHeight = (document.layers)?window.innerHeight:window.document.body.offsetHeight; var pageWidth = (document.layers)?window.innerWidth:window.document.body.offsetWidth; if (ns) { ypos = pageHeight / 2; var Write = '<div align="center" style="width:0px;height:0px;font-family:Arial,Verdana;font-size:'+currentStep/4+'px;color:'+colours[clrPos]+'">'+message[msgPos]+'</div>'; document.T.top = ypos + -currentStep / 8 + window.pageYOffset; document.T.document.write(Write) document.T.document.close(); } else { ypos = pageHeight / 2; xpos = pageWidth / 2; T.style.width = currentStep; T.style.pixelTop = ypos + -currentStep / 16 + document.body.scrollTop; T.style.pixelLeft = (xpos - 20)+ -currentStep / 2; T.style.fontSize = currentStep / 8; T.innerHTML = message[msgPos]; T.style.color = colours[clrPos]; } if (ns)step += 5; else step += 15; currentStep += step if (ns) { if (currentStep > pageWidth) { currentStep = 10; step = 8; msgPos += jog; clrPos += jog; } if (clrPos >= colours.length) clrPos = 0; } else { if (currentStep > pageWidth * siZe) { currentStep = 10; step = 8; msgPos += jog; clrPos += jog; } if (clrPos >= colours.length) clrPos = 0; } if (msgPos >= message.length) { clearTimeout(timer); if (ns) document.T.visibility = viz; else T.style.visibility = viz; } <!--在此修改文字顯示的速度--> timer = setTimeout("wenchin()",50) } --> </script> <body onLoad="wenchin()"> <!--迎面而來的文字_結束--> |
全站熱搜
留言列表