Digital Clock
The time is only set, when the page is (re)loaded).
There
must
be a subdirectory containing:
the digit image files (0.gif through 9.gif),
a colon seperator image file (c.gif),
am and pm indicators (am.gif, pm.gif).
Example:
Follow the editing instructions after the // and within the <!--comment tags-->
to customize the script, then copy and paste it into your HTML editor.
<!--Place this script in the HEAD section.--> <script language="JavaScript"> <!-- var Temp; setClock(); function setClock() { var OpenImg='<IMG SRC="'+pathOnly(location.href)+'digits/'+'' var CloseImg='.gif" HEIGHT=21 WIDTH=16>' Temp = "" now = new Date(); var CurHour = now.getHours(); var CurMinute = now.getMinutes(); now = null; if (CurHour >= 12) { CurHour = CurHour - 12; Ampm = "pm"; } else Ampm = "am"; if (CurHour == 0) CurHour = "12" if (CurMinute < 10) CurMinute="0" + CurMinute else CurMinute=""+CurMinute CurHour=""+CurHour; for (Count=0; Count < CurHour.length; Count++) { Temp+=OpenImg+CurHour.substring(Count,Count+1) +CloseImg} Temp += OpenImg + "c" + '.gif" HEIGHT=21 WIDTH=9>' for (Count = 0; Count < CurMinute.length; Count++) { Temp+=OpenImg+CurMinute.substring(Count,Count+1)+CloseImg} Temp += OpenImg + Ampm + CloseImg } function pathOnly (InString) { LastSlash=InString.lastIndexOf ('/', InString.length-1) OutString=InString.substring (0, LastSlash+1) return (OutString); } //--> </script> <!--Insert this anywhere on your page.--> <script>document.write(Temp);</script>