安裝: 步驟一 拷貝以下腳本後貼在有關網頁的 HEAD 之中。 <SCRIPT> <!-- // used to track position in message var i = 0; // used to cycle thru messages var TextNumber = 0; // array of messages var TextInput = new Object(); // used to load manipulate message var HelpText=""; // used to load message var Text = ""; // length of timeout (smaller is faster) var Speed=150; // added to end of each message to create a pause var WaitSpace=" " // used to position text in ver 2.0 var addPadding=""; // Each element of TextInput represents a single message. TextInput[0] = "李雋青詞 姚敏曲"; TextInput[1] = "想得我腸兒寸斷"; TextInput[2] = "望得我眼兒欲穿"; TextInput[3] = "好容易望到了你回來"; TextInput[4] = "算算已三年"; TextInput[5] = "想不到才見面"; TextInput[6] = "別離又在明天"; TextInput[7] = "這一回你去了幾時來"; TextInput[8] = "難道又三年"; TextInput[9] = "左三年 右三年"; TextInput[10] = "這一生見面有幾天"; TextInput[11] = "橫三年 堅三年"; TextInput[12] = "還不如不見面"; TextInput[13] = "明明不能留戀"; TextInput[14] = "偏要苦苦纏綿"; TextInput[15] = "為什麼放不下這條心"; TextInput[16] = "情願受熬煎"; TotalTextInput = 16; // (0, 1, 2, 3, 4, 5, 6, 7) // Positioning and speed vary between versions. var Version = navigator.appVersion; if (Version.substring(0, 1)==3) { Speed=200; addPadding=""; } for (var addPause = 0; addPause <= TotalTextInput; addPause++) {TextInput[addPause]=addPadding+TextInput[addPause]+WaitSpace;} var TimerId var TimerSet=false; // Called by the Start button. function startMessage() { if (!TimerSet) { TimerSet=true; teletype(); } } // Gets and displays character from rollMessage() . // Variable Speed controls length of timeout and thus the speed of typing. function teletype() { Text=rollMessage(); TimerId = setTimeout("teletype()", Speed) document.forms[0].elements[0].value=Text; } // Pulls one character at a time from string and returns (as Text) to function teletype() for displaying. function rollMessage () { Wait_yn=false; i++; var CheckSpace = HelpText.substring(i-1, i); CheckSpace = "" + CheckSpace; if (CheckSpace == " ") {i++;} if (i >= HelpText.length+1) { i=0; if (TextNumber < TotalTextInput) {TextNumber++;} else {TextNumber = 0;} initMessage(); } Text = HelpText.substring(0, i); return (Text); } // Called from onLoad in BODY tag & resetDisplay(). function titleDisplay() { document.forms[0].elements[0].value="點擊下面三鍵操控。"; initMessage(); } // Sets Text & HelpText equal to messages for use in rollMessage (). function initMessage() { Text = TextInput[TextNumber] HelpText = Text; } // Called by Stop button. function stopMessage() { TimerSet=false; clearTimeout (TimerId); } // Called by Reset button. function resetDisplay() { TimerSet=false; clearTimeout (TimerId); TextNumber=0; i=0; titleDisplay(); } --> </SCRIPT> <form> <TABLE bgcolor="#025B75" WIDTH=200> <TR><TD COLSPAN="3"><TEXTAREA ROWS=1 COLS=28 wrap=yes></TEXTAREA> </TD></TR> <TR> <TD align="center"><INPUT TYPE="button" VALUE="啟動" onClick="startMessage()"> <TD align="center"><INPUT TYPE="button" VALUE="重頭" onClick="resetDisplay()"> <TD align="center"><INPUT TYPE="button" VALUE="暫停" onClick="stopMessage()"> </TD></TR></TABLE> </center> 步驟二 拷貝以下代碼加在<body>之內。 onLoad="titleDisplay()"
安裝:
步驟一 拷貝以下腳本後貼在有關網頁的 HEAD 之中。
步驟二 拷貝以下代碼加在<body>之內。
onLoad="titleDisplay()"