中国特色的时间提醒
2010-02-01 12:41
169 查看
具有中国特色的时间提醒,blogbus后台的时间提示js代码,封装后的代码点击下载:date.js
Code:function welcomeText(username) {
var time = ['子时', '丑时', '寅时', '卯时', '辰时', '巳时', '午时', '未时', '申时', '酉时', '戌时', '亥时'];
var text = ['夜半销魂,谁人歌', '雄鸡未鸣,身未起', '风雨如晦,平旦出', '旭日东升,无往复', '君子勿劳,朝食饱', '鸡栖于莳,河清定', '善行无迹,恒德足', '日过中天,骄未散 ', '哺鹊进食,斜阳归', '鸡栖于埘,日沉坡', '日暮将至,归田园', '人定归本,早安眠'];
var arr_week = ['', '星期一','星期二','星期三','星期四','星期五','星期六','星期日'];
hour = new Date().getHours();
year = new Date().getFullYear();
month = new Date().getMonth();
dayx = new Date().getDate();
monthx = month+1;
week = arr_week[new Date().getDay()];
hourx = Math.ceil(hour/2);
if (hourx == 12) { hourx = 0; }
var today = year+"年"+monthx+"月"+dayx+"日 "+week;
second = new Date().getSeconds();
if(second % 2 == 0){
welcome = "<span class=\"userInfo\">"+username + "</span> <span class=\"greeting\" title=\""+today+"\"><strong>" + time[hourx] + "</strong> " + text[hourx] + "</span>";
}
return welcome = "<span class=\"userInfo\">"+username + "</span> <span class=\"greeting\" title=\""+today+"\"><strong>" + time[hourx] + "</strong> " + text[hourx] + "</span>";
}
在你要的地方调用:
Code:<script>document.write(welcomeText("您好,"))</script>
文章来源于 前端开发,网站设计,优化运营--mon的博客:http://monw3c.blogbus.com/logs/56304645.html本文出自 “前端开发网站设计” 博客,请务必保留此出处http://kan831019.blog.51cto.com/1226250/272827
Code:function welcomeText(username) {
var time = ['子时', '丑时', '寅时', '卯时', '辰时', '巳时', '午时', '未时', '申时', '酉时', '戌时', '亥时'];
var text = ['夜半销魂,谁人歌', '雄鸡未鸣,身未起', '风雨如晦,平旦出', '旭日东升,无往复', '君子勿劳,朝食饱', '鸡栖于莳,河清定', '善行无迹,恒德足', '日过中天,骄未散 ', '哺鹊进食,斜阳归', '鸡栖于埘,日沉坡', '日暮将至,归田园', '人定归本,早安眠'];
var arr_week = ['', '星期一','星期二','星期三','星期四','星期五','星期六','星期日'];
hour = new Date().getHours();
year = new Date().getFullYear();
month = new Date().getMonth();
dayx = new Date().getDate();
monthx = month+1;
week = arr_week[new Date().getDay()];
hourx = Math.ceil(hour/2);
if (hourx == 12) { hourx = 0; }
var today = year+"年"+monthx+"月"+dayx+"日 "+week;
second = new Date().getSeconds();
if(second % 2 == 0){
welcome = "<span class=\"userInfo\">"+username + "</span> <span class=\"greeting\" title=\""+today+"\"><strong>" + time[hourx] + "</strong> " + text[hourx] + "</span>";
}
return welcome = "<span class=\"userInfo\">"+username + "</span> <span class=\"greeting\" title=\""+today+"\"><strong>" + time[hourx] + "</strong> " + text[hourx] + "</span>";
}
在你要的地方调用:
Code:<script>document.write(welcomeText("您好,"))</script>
文章来源于 前端开发,网站设计,优化运营--mon的博客:http://monw3c.blogbus.com/logs/56304645.html本文出自 “前端开发网站设计” 博客,请务必保留此出处http://kan831019.blog.51cto.com/1226250/272827
相关文章推荐
- centos 更改系统时间 为上海/中国时间
- 中国特色的流程需求
- 中国特色小吃英文词汇大全
- 新浪微博推出具有中国特色的“关注但屏蔽”功能
- ebay 付款时间 跟中国时间的关系
- 中国特色的软件
- [浪子学编程][MS Enterprise Library]ObjectBuilder内功心法之中国特色
- 有中国特色的价值投资
- 详细时间提醒信息
- iOS 世界时间转化为中国时间
- 【开心一刻】具有中国特色的脑筋急转弯
- 将中国标准时间转换成标准格式的代码
- 中国特色的罚款经济学
- 时间过得真快,中国足球已经离我5年了!
- 具有中国特色的脑筋急转弯
- 中国计算机软件专业技术资格和水平考试各地咨询地址和报名时间
- Excel 用两种方法制作中国特色斜线表头
- 发展人工智能的中国特色
- 做有中国特色的程序员
- EKReminder 根据时间提醒 和地理围栏