728x90
반응형
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> myclock = new Array() for (i = 0; i < 13; i++) { myclock[i] = new Image() myclock[i].src = "clock" + i + ".gif"; } function showTime() { var today = new Date(); var hour = today.getHours(); var minute = today.getMinutes(); var second = today.getSeconds(); if (hour < 12) { document.i.src = "clock10.gif"; } else { document.i.src = "clock11.gif"; } if (hour > 12) { hour = hour - 12; } if (hour >= 10) { var my1 = String(hour).charAt(0); var my2 = String(hour).charAt(1); } else { var my1 = 0; var my2 = String(hour); } if (minute >= 10) { var my3 = String(minute).charAt(0); var my4 = String(minute).charAt(1); } else { var my3 = 0; var my4 = String(minute); } if (second >= 10) { var my5 = String(second).charAt(0); var my6 = String(second).charAt(1); } else { var my5 = 0; var my6 = String(second); } document.a.src = "clock" + my1 + ".gif"; document.b.src = "clock" + my2 + ".gif"; document.c.src = "clock12.gif"; document.d.src = "clock" + my3 + ".gif"; document.e.src = "clock" + my4 + ".gif"; document.f.src = "clock12.gif"; document.g.src = "clock" + my5 + ".gif"; document.h.src = "clock" + my6 + ".gif"; timeid = setTimeout("showTime()", 1000); } </SCRIPT> </HEAD> <BODY onload="showTime()"> <IMG SRC="clockblank.gif" NAME="a" WIDTH="18" HEIGHT="21"> <IMG SRC="clockblank.gif" NAME="b" WIDTH="18" HEIGHT="21"> <IMG SRC="clockblank.gif" NAME="c" WIDTH="9" HEIGHT="21"> <IMG SRC="clockblank.gif" NAME="d" WIDTH="18" HEIGHT="21"> <IMG SRC="clockblank.gif" NAME="e" WIDTH="18" HEIGHT="21"> <IMG SRC="clockblank.gif" NAME="f" WIDTH="9" HEIGHT="21"> <IMG SRC="clockblank.gif" NAME="g" WIDTH="18" HEIGHT="21"> <IMG SRC="clockblank.gif" NAME="h" WIDTH="18" HEIGHT="21"> <IMG SRC="clockblank.gif" NAME="i" WIDTH="18" HEIGHT="21"> </BODY> </HTML> | cs |
728x90
반응형