¦b DHTML ¤¤¨Ï¥Î Script ±Ôz§ïÅܺô¶¤º®e¤Î®æ¦¡¡A¥i¤À¬°¨â¤jÃþ¡G
- ¸ü¤J¦P®É¨Ì±ø¥ó¦¡¿é¥Xºô¶¤º®e¡A¾Þ§@ªº¬O document ª«¥óªº write() ¤èªk¡C
- ¸ü¤J§¹¦¨«á¨ÌÂsÄýªÌ¾Þ§@¦Ó§ïÅܺô¶¤º®e¡A©Ò¦³ºô¶ª«¥ó³£¦³¥i¯à³Q¾Þ§@¡A
n¨Ï¥Î¨ººØ¤èªkn¨Ì»Ýn§ïÅܨººØª«¥ó¦Ó©w¡C
¦b¥»½d¨Ò¤¤§Ú̱ĥβĤ@ºØ¤èªk¦p¤U¡G
if (objDate.getHours()>=6 && objDate.getHours()<=18)
{
/* ³]©wºô¶®æ¦¡ªº Style ¬° day¡A²LÂÅ©³¶Â¦r¡C */
document.write('<BODY CLASS="day">');
/* ¥Õ¤Ñ¨Ï¥Î¤Ó¶§¹Ï¤ù */
document.write('<IMG SRC="sun.gif">');
}
else
{
/* ³]©wºô¶®æ¦¡ªº Style ¬° night¡A²`ÂÅ©³¥Õ¦r¡C */
document.write('<BODY CLASS="night">');
/* ©]±ß¨Ï¥Î¤ë«G¹Ï¤ù */
document.write('<IMG SRC="moon.gif">');
}
/* ¿é¥X®É¶¡¦r¦êÅã¥Ü¦bºô¶¤W */
document.write('<BR><BR>²{¦b®É¶¡¬O¡G<B>');
if (objDate.getHours()/12>1)
{document.write('¤U¤È ');}
else
{document.write('¤W¤È ');}
document.write((objDate.getHours() % 12)+"ÂI");
document.write(objDate.getMinutes()+"¤À");
document.write(objDate.getSeconds()+"’</B>");