タイマー付きスクローラー

 スクローラーに時計を付加したものです。時刻表示は12時間制になっています。使い方はスクローラー1と同じです。


◆スクリプト
<SCRIPT Language="JavaScript"><!--
	stcnt = 0;
	msg = "New Scroller with Timer (1 byte code only) ... 1996 program by K.Furuhata / OpenSpace ";
	blnk = "                                              ";
	str = blnk + blnk + blnk + msg;
function scroller()
{
	apm="午前";
	ct = new Date();
	h = ct.getHours();
	if (h>12) {apm="午後"; h-=12;}
	h = "0"+h;
	m = "0"+ct.getMinutes();
	s = "0"+ct.getSeconds();
	h = h.substring(h.length-2,h.length+1);
	m = m.substring(m.length-2,m.length+1);
	s = s.substring(s.length-2,s.length+1);
	cl = "現在時刻【"+h+"時"+m+"分"+s+"秒】";
	window.status = cl+str.substring(stcnt++,str.length+1);
	if (stcnt>str.length) stcnt=0;
	timeID = window.setTimeout("scroller()",100);
}
// --></SCRIPT>