您好,欢迎访问一九零五行业门户网

一个非常精彩的日历程序_PHP教程

豆腐制作 都是精品
http://www.asp888.net 豆腐技术站
我们经常需要的一些web项目中用到日历,这样的脚本写起来又麻烦,功能又不够强大,现在豆腐给大家
提供一个功能强大的日历程序,这段脚本使用完全的客户端的js脚本制作,运行速度快。
下面大家就来看看,还有什么需要改进的地方,先看看效果再说吧!日历演示
豆腐日历
function gettoday() {
//得到今天的年,月,日
this.now = new date();
this.year = this.now.getfullyear();
this.month = this.now.getmonth();
this.day = this.now.getdate();
}
today = new gettoday();
function newcalendar() {
today = new gettoday();
var parseyear = parseint(document.all.year
[document.all.year.selectedindex].text);
var newcal = new date(parseyear,
document.all.month.selectedindex, 1);
var day = -1;
var startday = newcal.getday();
var daily = 0;
if ((today.year == newcal.getfullyear()) &&(today.month == newcal.getmonth()))
day = today.day;
var tablecal = document.all.calendar.tbodies.daylist;
var intdaysinmonth =getdays(newcal.getmonth(), newcal.getfullyear());
for (var intweek = 0; intweek for (var intday = 0;intday {
var cell = tablecal.rows[intweek].cells[intday];
if ((intday == startday) && (0 == daily))
daily = 1;
if(day==daily)
//今天,调用今天的class
cell.classname = today;
else if(intday==6)
//周六
cell.classname = sunday;
else if (intday==0)
//周日
cell.classname =satday;
else
//平常
cell.classname=normal;
if ((daily > 0) && (daily {
cell.innertext = daily;
daily++;
}
else
cell.innertext = ;
}
}
function getdate() {
var sdate;
//这段代码处理鼠标点击的情况
if (td == event.srcelement.tagname)
if ( != event.srcelement.innertext)
{
sdate = document.all.year.value + 年 + document.all.month.value + 月 + event.srcelement.innertext + 日;
alert(sdate);
}
}
豆腐制作,都是精品
豆腐技术站为大家提供最新最好的技术
function cancel() {
document.all.ret.value = ;
window.close();
}
http://www.bkjia.com/phpjc/532512.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/532512.htmltecharticle豆腐制作 都是精品 http://www.asp888.net 豆腐技术站 我们经常需要的一些web项目中用到日历,这样的脚本写起来又麻烦,功能又不够强大,现在...
其它类似信息

推荐信息