域名注册
|
虚拟主机
|
数据库
|
设为主页
|
加入收藏
|
天诚搜索
|
RSS
网站套餐
Package
基础特惠型网站
企业标准型网站
企业大户型网站
商务政务型网站
功能单项报价表
最新推荐
Recommended
4年网络创业经历
Dreamweaver表格经验谈
61.183.41.123数据重新上传通…
局域网arp病毒
用途相似的标签
CSS网页标准制作关于网页表单…
中国互联网13年大事记
ECSHOP 显示指定分类下的文章…
您现在的位置:
天诚世纪
>>
技术中心
>>
网页特效
>>
时间日期
>> 正文
状态栏滚动时间
作者:
天诚世纪
更新时间:2009-6-16 11:12:42
来源:
天诚世纪
以下是HTML网页特效代码,点击运行按钮可查看效果:
<html> <head> <title>网页特效|tc-21.com|---状态栏滚动时间</title> </head><body>请看状态栏<BR> <!--将以下代码加入HTML的<Body></Body>之间--> <SCRIPT language=JavaScript> var osd = " " osd +=""; var timer; var msg = ""; function scrollMaster () { msg = customDateSpring(new Date()) clearTimeout(timer) msg += " " + showtime() + " " + osd for (var i= 0; i < 100; i++){ msg = " " + msg; } scrollMe() } function scrollMe(){ window.status = msg; msg = msg.substring(1, msg.length) + msg.substring(0,1); timer = setTimeout("scrollMe()", 200); } function showtime (){ var now = new Date(); var hours= now.getHours(); var minutes= now.getMinutes(); var seconds= now.getSeconds(); var months= now.getMonth(); var dates= now.getDate(); var years= now.getYear(); var timeValue = "" timeValue += ((months >9) ? "" : " ") timeValue += ((dates >9) ? "" : " ") timeValue = ( months +1) timeValue +="/"+ dates timeValue +="/"+ years var ap="A.M." if (hours == 12) { ap = "P.M." } if (hours == 0) { hours = 12 } if(hours >= 13){ hours -= 12; ap="P.M." } var timeValue2 = " " + hours timeValue2 += ((minutes < 10) ? ":0":":") + minutes + " " + ap return timeValue2; } function MakeArray(n) { this.length = n return this } monthNames = new MakeArray(12) monthNames[1] = "一月" monthNames[2] = "二月" monthNames[3] = "三月" monthNames[4] = "四月" monthNames[5] = "五月" monthNames[6] = "六月" monthNames[7] = "七月" monthNames[8] = "八月" monthNames[9] = "九月" monthNames[10] = "十月" monthNames[11] = "十一月" monthNames[12] = "十二月" daysNames = new MakeArray(7) daysNames[1] = "周日" daysNames[2] = "周一" daysNames[3] = "周二" daysNames[4] = "周三" daysNames[5] = "周四" daysNames[6] = "周五" daysNames[7] = "周六" function customDateSpring(oneDate) { var theDay = daysNames[oneDate.getDay() +1] var theDate =oneDate.getDate() var theMonth = monthNames[oneDate.getMonth() +1] var dayth="号" if ((theDate == 1) || (theDate == 21) || (theDate == 31)) { dayth="st"; } if ((theDate == 2) || (theDate ==22)) { dayth="nd"; } if ((theDate== 3) || (theDate == 23)) { dayth="rd"; } return theDay + ", " + theMonth + " " + theDate + dayth + "," } scrollMaster(); </SCRIPT> </body></html>
.
[提示:可先修改代码再按运行]
本文链接:http://www.tc-21.com/ITCenter/200906/20090616111242.html
上一篇文章:
随时间变化提示
下一篇文章:
记录几天后的日期
更多关于
时间日期
的新闻
相关文章
农历日历
Form中的时钟
立体显示的时钟
显示特殊节日脚本
退出时显示访问时间
各种风格时间显示
使时钟显示在任意指定的位置
倒计时
::::::
网页模板
|
建站指导
|
视频教程
|
图片中心
|
在线咨询
|
网站运营
|
网站推广
|
图片素材
::::::
CopyRight 2007 All Rights Reserved 天诚世纪 版权所有
鄂ICP备12000046号
联系电话:18995527083 18995527081 QQ:448163207 32301667 Email:my_tc@126.com
::::::搜索关键字:
武汉网站制作
|
武汉做网站
|
武汉网站建设
|
武汉网页制作
|
天诚世纪
|
武汉网页制作公司
|
网页模板
|::::::