状态栏滚动时间
2008-04-02 09:51:25来源:互联网 阅读 ()
代码
<html>
<head>
<title>免费网络-网页特效-状态栏滚动时间</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>
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
上一篇:注册送1美元的在线网络回拨电话
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash