![]()
ステータスに文字をタイプで打つように表示されます。
|
<html><head><title>ステータス・スクロール3</title> <SCRIPT Language="JavaScript"> <!-- { this.length = n; for (i=0; i<n; i++) this[i]=""; } str = "このように文字がタイプされていきます!!"; // strにスクロースさせる文字列をセットしておきます。 blnk = " "; str += blnk; mcnt = 0; msg = ""; stcnt=0; function wiper() { stcnt++; if (stcnt>3) { stcnt = 0; msg += str.substring(mcnt,mcnt+1); mcnt++; if (mcnt >= str.length) { mcnt=0; msg=""; } } csr = " "; if (stcnt & 1) csr ="_"; window.status = msg+csr; timeID = window.setTimeout("wiper()",100); } // --> </SCRIPT> </head> <body onLoad="wiper()"> <!-- ここより下に通常のHTML文を挿入 --> </body></html> |
また、日本語を使うと、Netscape Navigatorで文字化けを起こしますので注意して下さい!