全天候的JavaScript时间问候语_日期时间特效

模板酷站

      很不错的时间特效,全天候的JavaScript时间问候语,几乎每一个小时都有相应的提示,比起网上一般的问候语更温馨些,也更多一些,直接复制代码加到你的网页中就可以用啦,你可以自己修改一下问候语,变为你自己更修改一点的。


      <html> <head> <title>全天候的JS时间提示语</title> <body> <script language="JavaScript"> <!-- document.write("<center><font color=#990099 size=-1> ") day = new Date() hr = day.getHours() minu=day.getMinutes() s="您好,现在的时间是:"; s=s+hr+"点"+minu+"分。 "; if (hr ==1) document.write(s+"一点多啦!别忘了休息哦!") if (hr ==2) document.write(s+"你真是工作狂啊,该休息了,身体是革命的本钱!") if (hr ==3) document.write(s+"午夜三点!你还不准备睡觉吗?") if (hr ==4) document.write(s+"凌晨四点多了,一定要把您这种忘我的工作精神上报中央!") if (hr ==5) document.write(s+"您是刚起床还是还没睡啊?") if (hr ==6) document.write(s+"早上好!新一天又开始啦!有什么打算呢?") if (hr ==7) document.write(s+"吃过早饭了吗?") if ((hr ==8) || (hr == 9) || (hr ==10)) document.write(s+"早!又是忙碌的一天!") if (hr ==11) document.write(s+"快中午啦,准备做饭了呀!") if (hr ==12) document.write(s+"中午好!你吃饭了吗?") if ((hr==13) || (hr==14)) document.write(s+"下午好,准备准备要上班了!") if ((hr==15) || (hr==16) || (hr==17)) document.write(s+"下午好!") if ((hr==18) || (hr==19)) document.write(s+"新闻联播你看了吗?吃晚饭了没?") if ((hr==20) || (hr==21) || (hr==22)) document.write(s+"别工作了,找个电影看看睡觉吧?") if (hr==23) document.write(s+"不早了,快休息吧?") if (hr==0) document.write(s+"午夜时分,你可要注意身体呢!") document.write("</font></center>") //---> </script> </body> </html>