打印本文 打印本文 关闭窗口 关闭窗口
一个很好的日历控件(采用javascript编写)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2702  更新时间:2009/4/23 11:28:03  文章录入:mintao  责任编辑:mintao
 

该日历控件采用js编写,来自MS的 http://expo.live.com,本站整理,希望对大家有用。

本程序中需要的两个图片:
http://expo.live.com/Images/leftArrow.gif
http://expo.live.com/Images/rightArrow.gif


Global.css

 

td.negDate  a
{
       color: #808080;
}
.calendar
{

       padding-left: 4px;

       padding-right: 4px;

}

.calendar table
{

       border-bottom: solid 1px #366AB3;

       text-align: center;

       padding: 0;

}

.calendar table a
{

       color: black;

}

.calendar td {

       padding: 4px;

       font-size: 8pt;

       font-weight: lighter;

}

.calendarhd
{

       color: #366AB3;

       text-transform: uppercase;

}

.calendarDays
{

       border-bottom: solid 1px;

       color: #808080;

       padding: 0;

       margin: 0;

}

.selectedDate {

      background: orange;

}

.selectedDate a {

       color: white !important;

}

 

Global.js

 

var calendar_DayNames = new Array("日","一","二","三","四","五","六");

var calendar_MonthNames = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");

 

function showCalendar(targetID, targetURL, dMonth, dYear, dDay)

{

    if(dMonth < 0)

    {       

        dMonth = 11;

        dYear--;

    }

    if(dMonth > 11)

    {

        dMonth = 0;

        dYear++;

    }

 

    var dNow = new Date();

    if(dDay == 90 && dMonth == dNow.getMonth() && dYear == dNow.getYear()) dDay = dNow.getDate();

    var dCurFD = new Date(dYear, dMonth, 1);

    var dGivenDate = new Date(dYear, dMonth, dDay); 

    var dCurrentMonthFirstSunday = dCurFD.getDay();

    var dCurrentViewDate = new Date(dCurFD);

    var iDays = 0;

[1] [2] [3]  下一页

打印本文 打印本文 关闭窗口 关闭窗口