| 网站首页 | 模板 | 资料 | 源码 | 工具 | 开发 | 设计 | 安全 | 项目 | 网络 | 图片 | 系统 | 数据库 | 博客 | 会员中心 | 小说 | 
MYFTP 精品资料下载
网络学院
学习资料
源码模版
您现在的位置: 精品下载 >> 开发 >> 网站开发 >> CSS技术 >> 文章正文 用户登录 新用户注册
HTML组件(HTML COMPONENTS)之四编写日历(3)            【字体:
HTML组件(HTML COMPONENTS)之四编写日历(3)
作者:佚名    文章来源:不详    点击数:    更新时间:2007-12-18
===编写日历一===

setCal()函数是主模块,我们在脚本的第一行调用它。该函数为当天(now)、和每月的第一天(firstDayInstance)建立一个Date对象。用这些对象,setCal()函数解析出关于一个月的第一天、当日,和最后一天的所有信息。

function setCal() {
// standard time attributes
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth();
var monthName = getMonthName(month);
var date = now.getDate();
now = null;

// create instance of first day of month, and extract the day on which it occurs
var firstDayInstance = new Date(year, month, 1);
var firstDay = firstDayInstance.getDay();
firstDayInstance = null;

// number of days in current month
var days = getDays(month, year);

// call function to draw calendar
drawCal(firstDay + 1, days, date, monthName, year);
}

文章录入:chqnet    责任编辑:chqnet 
  • 上一篇文章:

  • 下一篇文章:
  • 最新热点 最新推荐 相关文章
    使用html表格和CSS进行混合网
    Html网页页面head区规范知识
    两分钟做个xhtml+css的网站首
    实用HTML文件的增强标记
    JDK 6.0--总述及XML的新标
    采用XHTML和CSS设计可重用可
    HTML中小meta的大作用
    HTML特殊字符显示
    HTML标记全集
    HTMLCSS教程
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)