25、随时间变化提示 代码

25、随时间变化提示 代码

脚本说明:

把如下代码加入<body>区域中

<SCRIPT language="JavaScript">

<!-----------

   var enabled = 0;   today = new Date();

   var day;   var date;

   if(today.getDay()==0)     day = "星期日"

   if(today.getDay()==1)     day = "星期一"

   if(today.getDay()==2)     day = "星期二"

   if(today.getDay()==3)     day = "星期三"

   if(today.getDay()==4)     day = "星期四"

   if(today.getDay()==5)     day = "星期五"

   if(today.getDay()==6)     day = "星期六"

   document.fgColor = " FF0072";

   date1 = "<font size=2 color=red>" + (today.getYear())  + "" + (today.getMonth() + 1 ) + "" + today.getDate() + "  " + "</font>";

   date2 = "<font size=1 color=red>" +  day + "</font>";

   document.write("<center>" + date1.fontsize(3) + date2.fontsize(3) + "</center>");

  

//----->

</SCRIPT>

<SCRIPT language="JavaScript">

 

<!--

document.write("<center><font color=#0066ff size=+1> ")

day = new Date()

hr = day.getHours()

if (hr ==1)

document.write("凌晨一点已过,别忘了休息喔!")

if (hr ==2)

document.write("该休息了,身体可是革命的本钱啊!")

if (hr ==3)

document.write("夜深人静,只有你敲击鼠标的声音...")

if (hr ==4)

document.write("四点过了,你明天不上班???")

if (hr ==5)

document.write("该去晨运了!!!")

if (hr ==6)

document.write("你知道吗,此时是国内网络速度最快的时候!")

if (hr ==7)

document.write("新的一天又开始了,祝你过得快乐!")

if ((hr ==8) || (hr == 9) || (hr ==10))

document.write("上午好!今天你看上去好精神哦!")

if (hr ==11)

document.write("十一点过了,快下班了吧?")

if (hr ==12)

document.write("十二点过了,还不下班?")

if ((hr==13) || (hr==14))

document.write("你不睡午觉?")

if ((hr==15) || (hr==16) || (hr==17))

document.write("下午好!")

if ((hr==18) || (hr==19))

document.write("吃晚饭了吧?")

if ((hr==20) || (hr==21) || (hr==22))

document.write("今晚又在这玩电脑了,没节目?")

if (hr==23)

document.write("真是越玩越精神,不打算睡了?")

if (hr==0)

document.write("凌晨了,还不睡?")

document.write("</font></center>")

//--->

 

</SCRIPT>

 

Write a comment

Comments: 0