close
語法說明:
1.在 var speed = 100; 中修改速度,數值越大就越慢,越小就越快
2.在 var biggest_text = 20; 修改文字最終呈現大小
3.在 var themessage2 = new initArray( "武陵春~李清照", "風住塵香花已盡,日晚倦梳頭。", "物是人非事事休,欲語淚先流。", "聞說雙溪春尚好,也擬泛輕舟。", "祗恐雙溪舴艋舟,載不動,許多愁。" 中修改顯示的文字內容,可自行增加或減少
<!--忽遠忽近的文字_開始--> <script language="Javascript"> <!-- var tags_before_clock = "<center>"; var tags_after_clock = "</center>"; var speed = 100; //速度,越大越慢 var speed2 = 2000; var biggest_text = 20; //文字最終呈現大小 var x = 0; var y = 0; var themessage, size; var esize = "</font>"; function initArray() { this.length = initArray.arguments.length; for (var i = 0; i < this.length; i++) { this[i] = initArray.arguments[i]; } } <!--在此修改顯示的文字內容--> var themessage2 = new initArray( "武陵春~李清照", "風住塵香花已盡,日晚倦梳頭。", "物是人非事事休,欲語淚先流。", "聞說雙溪春尚好,也擬泛輕舟。", "祗恐雙溪舴艋舟,載不動,許多愁。"); if(navigator.appName == "Netscape") { document.write('<layer id="wds"></layer><br>'); } if (navigator.appVersion.indexOf("MSIE") != -1){ document.write('<span id="wds"></span><br>'); } function upwords(){ themessage = themessage2[y]; if (x < biggest_text) { x++; setTimeout("upwords()",speed); } else { setTimeout("downwords()",speed2); } if(navigator.appName == "Netscape") { size = "<font point-size='"+x+"pt'>"; document.wds.document.write(size+tags_before_clock+themessage +tags_after_clock+esize); document.wds.document.close(); } if (navigator.appVersion.indexOf("MSIE") != -1){ wds.innerHTML = tags_before_clock+themessage+tags_after_clock; wds.style.fontSize=x+'px' } } function downwords(){ if (x > 1) { x--; setTimeout("downwords()",speed); } else { setTimeout("upwords()",speed2); y++; if (y > themessage2.length - 1) y = 0; } if(navigator.appName == "Netscape") { size = "<font point-size='"+x+"pt'>"; document.wds.document.write(size+tags_before_clock+themessage +tags_after_clock+esize); document.wds.document.close(); } if (navigator.appVersion.indexOf("MSIE") != -1){ wds.innerHTML = tags_before_clock+themessage+tags_after_clock; wds.style.fontSize=x+'px' } } setTimeout("upwords()",speed); --> </script> <!--忽遠忽近的文字_結束--> |
全站熱搜
留言列表