中国网站美工网!网页设计者的天堂!
本站特色:HTML网页模版下载    
  您的位置:

首页 >> 网页特效 >> 时间日期 >> 正文

相关信息

标准时间代码大全
日期时间都在一个按钮上显示
多种地域的时间显示
时间提示脚本 这个有点怪,时间
文本框内又一显示时间脚本
输入生日即可计算出下个生日的天
这个脚本只会显示年份和季节
一个以二进制显示的时钟
按钮显示时间 点击按钮显示页面
一个显示当前星期的起止日的脚本
在状态栏中显示停留时间
根据日期来显示当日的信息
显示星期中包含的日期数
真正的万年历!
中文星期
根据星期的不同分别指向指定页面
检测最近两个星期天的日期(当然
可以选择12小时、24小时制的时钟
给出两个日期,算出他们相差多少
计算当月剩余的天数(一般)

再放上一个万年历脚本

再放上一个万年历脚本


来源: 不详 | 时间: 2006-1-23 16:24:33 | 人气:

 

再放上一个万年历脚本

要完成此效果需要两个步骤

第一步:把如下代码加入到<body>区域中

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function setToday() {
var now   = new Date();
var day   = now.getDate();
var month = now.getMonth();
var year  = now.getYear();
if (year < 2000)  
year = year + 1900;
this.focusDay = day;
document.calControl.month.selectedIndex = month;
document.calControl.year.value = year;
displayCalendar(month, year);
}
function isFourDigitYear(year) {
if (year.length != 4) {
alert ("Sorry, the year must be four-digits in length.");
document.calControl.year.select();
document.calControl.year.focus();
} else { return true; }
}
function selectDate() {
var year  = document.calControl.year.value;
if (isFourDigitYear(year)) {
var day   = 0;
var month = document.calControl.month.selectedIndex;
displayCalendar(month, year);
    }
}

function setPreviousYear() {
var year  = document.calControl.year.value;
if (isFourDigitYear(year)) {
var day   = 0;
var month = document.calControl.month.selectedIndex;
year--;
document.calControl.year.value = year;
displayCalendar(month, year);
   }
}
function setPreviousMonth() {
var year  = document.calControl.year.value;
if (isFourDigitYear(year)) {
var day   = 0;
var month = document.calControl.month.selectedIndex;
if (month == 0) {
month = 11;
if (year > 1000) {
year--;
document.calControl.year.value = year;
}
} else { month--; }
document.calControl.month.selectedIndex = month;
displayCalendar(month, year);
   }
}
function setNextMonth() {
var year  = document.calControl.year.value;
if (isFourDigitYear(year)) {
var day   = 0;
var month = document.calControl.month.selectedIndex;
if (month == 11) {
month = 0;
year++;
document.calControl.year.value = year;
} else { month++; }
document.calControl.month.selectedIndex = month;
displayCalendar(month, year);
   }
}
function setNextYear() {
var year = document.calControl.year.value;
if (isFourDigitYear(year)) {
var day = 0;
var month = document.calControl.month.selectedIndex;
year++;
document.calControl.year.value = year;
displayCalendar(month, year);
   }
}
function displayCalendar(month, year) {      
month = parseInt(month);
year = parseInt(year);
var i = 0;
var days = getDaysInMonth(month+1,year);
var firstOfMonth = new Date (year, month, 1);
var startingPos = firstOfMonth.getDay();
days += startingPos;
document.calButtons.calPage.value  =   " Su Mo Tu We Th Fr Sa";
document.calButtons.calPage.value += "\n --------------------";
for (i = 0; i < startingPos; i++) {
if ( i%7 == 0 ) document.calButtons.calPage.value += "\n ";
document.calButtons.calPage.value += "   ";
}
for (i = startingPos; i < days; i++) {
if ( i%7 == 0 ) document.calButtons.calPage.value += "\n ";
if (i-startingPos+1 < 10)
document.calButtons.calPage.value += "0";
document.calButtons.calPage.value += i-startingPos+1;
document.calButtons.calPage.value += " ";
}
for (i=days; i<42; i++)  {

本新闻共2页,当前在第1页  1  2  

 
  上一篇:根据星期的不同分别指向指定页面  下一篇:中文星期
Copyright © 2005 - 2006 WEB600.Net,All Rights Reserved
业务联系 QQ 站长:106324307 美工:270348300 程序:63888546
E-mail: 3235183@163.com MSN: fuqiyangru@hotmail.com
中国网站美工网--网页设计者的天堂! 陕ICP备06005517号
本站资源来自互联网 如果侵犯您的权利 请通知我们 我们会尽快删除