zoukankan      html  css  js  c++  java
  • 分时段显示不同的提示的网页JS特效代码

     1 脚本说明:
     2 把如下代码加入body区域中
     3 <SCRIPT>
     4 today=new Date();
     5 var day; var date; var hello; var wel;
     6 hour=new Date().getHours()
     7 if(hour < 6)hello='凌晨好'
     8 else if(hour < 9)hello='早上好'
     9 else if(hour < 12)hello='上午好'
    10 else if(hour < 14)hello='中午好'
    11 else if(hour < 17)hello='下午好'
    12 else if(hour < 19)hello='傍晚好'
    13 else if(hour < 22)hello='晚上好'
    14 else {hello='夜里好!'}
    15 if(today.getDay()==0)day='星期日'
    16 else if(today.getDay()==1)day='星期一'
    17 else if(today.getDay()==2)day='星期二'
    18 else if(today.getDay()==3)day='星期三'
    19 else if(today.getDay()==4)day='星期四'
    20 else if(today.getDay()==5)day='星期五'
    21 else if(today.getDay()==6)day='星期六'
    22 date=(today.getYear())+''+(today.getMonth() + 1 )+''+today.getDate()+'';
    23 if(hour<1)wel='子时';
    24 else if(hour<3)wel='丑时';
    25 else if(hour<5)wel='寅时';
    26 else if(hour<7)wel='卯时';
    27 else if(hour<9)wel='辰时';
    28 else if(hour<11)wel='巳时';
    29 else if(hour<13)wel='午时';
    30 else if(hour<15)wel='未时';
    31 else if(hour<17)wel='申时';
    32 else if(hour<19)wel='酉时';
    33 else if(hour<21)wel='戌时';
    34 else if(hour<23)wel='亥时';
    35 else {wel='子时';}
    36 document.write(hello);
    37 </SCRIPT>! 现在是<SCRIPT>
    38 document.write(date + ' ' + day + ' ' + wel);
    39     </SCRIPT> 
  • 相关阅读:
    美国队长
    weka数据预处理
    weka特征选择(IG、chi-square)
    生成arff文件,csv转为arff
    logistic regression的一些问题,不平衡数据,时间序列,求解惑
    Feature Scaling
    【转】机器学习问题方法总结
    Canopy算法聚类
    ROC曲线及AUC评价指标
    评估指标:准确率(Precision)、召回率(Recall)以及F值(F-Measure)
  • 原文地址:https://www.cnblogs.com/yangguoe/p/8463668.html
Copyright © 2011-2022 走看看