11-2 節《顯示圖形系統時間》


製作:王國榮

 

  • Source

    <HTML>
    <BODY OnLoad="ShowTime();" TEXT="#000000" BGCOLOR="#D0ECD0" LINK="#0000FF" VLINK="#008000" ALINK="#008000">
    
    <!-- 以下是顯示「系統日期時間」的 Java Script 程式 -->
    <SCRIPT Language="JavaScript">
       function ShowTime() {
       D = new Date(); 
          hh = D.getHours(); mm = D.getMinutes();    ss = D.getSeconds();
          yy = D.getYear();  mt = D.getMonth() + 1;  dd = D.getDate();
    
          document.images[8].src = Url(hh/10);    document.images[9].src = Url(hh%10);
          document.images[11].src = Url(mm/10);   document.images[12].src = Url(mm%10);
          document.images[14].src = Url(ss/10);   document.images[15].src = Url(ss%10);
    
          document.images[0].src = Url(mt/10);    document.images[1].src = Url(mt%10);
          document.images[3].src = Url(dd/10);    document.images[4].src = Url(dd%10);
          document.images[6].src = Url(yy/10);    document.images[7].src = Url(yy%10);
    
          window.setTimeout("ShowTime()", 500);
       }
    
       function Url(num) {
          num = Math.floor(num);
          return "n" + num + ".gif";
       }
    </SCRIPT>
    
    <H2 ALIGN=CENTER>11-2 節《顯示圖形系統時間》
    <HR WIDTH="100%"></H2>
    
    <IMG Src="n6.gif" Height=19 Width=14><IMG Src="n7.gif" Height=19 Width=14><IMG Src="dash.gif" Height=19 Width=9><IMG Src="n8.gif" Height=19 Width=14><IMG Src="n9.gif" Height=19 Width=14><IMG Src="dash.gif" Height=19 Width=9><IMG Src="n0.gif" Height=19 Width=14><IMG Src="n0.gif" Height=19 Width=14>
     <IMG Src="n0.gif" Height=19 Width=14><IMG Src="n1.gif" Height=19 Width=14><IMG Src="colon.gif" Height=19 Width=9><IMG Src="n2.gif" Height=19 Width=14><IMG Src="n3.gif" Height=19 Width=14><IMG Src="colon.gif" Height=19 Width=9><IMG Src="n4.gif" Height=19 Width=14><IMG Src="n5.gif" Height=19 Width=14>
    
    <HR Width="100%">
    <ADDRESS>製作:王國榮</ADDRESS>
    
    </BODY>
    </HTML>