当前位置: 首页 > 图文教程 > 网页制作 > HTML/XHTML教程 > 源码学习:一个简单的日历控件(1)

HTML/XHTML教程
通过W3C XHTML1.0及CSS标准必须注意的九个问题
注意这11个问题保证CSS的渲染效率
用css+js定义input_file元素的样式来兼容FireFox
CSS技巧:如何使未知高宽的图片实现垂直居中
CSS基础教程:布局网页技巧的完全学习手册
css知识:Div和Span在使用中的不同之处
css技巧:批量保存div+css网页中的图片的几种方法
CSS技巧:常用的属性代码简化表
介绍二款b/s开发中常用小工具
css教程:IE6、IE7和FF的hack的运用技巧
Google改进SSL机制,控制SSL安全机制存漏洞
css技巧:分享9个网页制作常用技巧
规范Web站点设计css类以及id的命名方式
html教程:WEB标准从头开始_DOCTYPE声明
html/css教程:背景图片的定位问题详解
CSS教程:自动隐藏网页文字的技巧
汇总一些IE与Firefox的CSS兼容问题及解决办法
网页中利用Title属性的好处
40多个漂亮的网页表单设计实例
制作商业HTML邮件的建议

HTML/XHTML教程 中的 源码学习:一个简单的日历控件(1)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-04   浏览: 52 ::
收藏到网摘: n/a

 
calendar.js

   function atCalendarControl(){
  var calendar=this;
  this.calendarPad=null;
  this.prevMonth=null;
  this.nextMonth=null;
  this.prevYear=null;
  this.nextYear=null;
  this.goToday=null;
  this.calendarClose=null;
  this.calendarAbout=null;
  this.head=null;
  this.body=null;
  this.today=[];
  this.currentDate=[];
  this.sltDate;
  this.target;
  this.source;

  /************** 加入日历底板及阴影 *********************/
  this.addCalendarPad=function(){
   document.write("<div id='divCalendarpad' style='position:absolute;top:100;left:0;width:255;height:167;display:none;'>");
   document.write("<iframe frameborder=0 height=168 width=255></iframe>");
   document.write("<div style='position:absolute;top:4;left:4;width:248;height:164;background-color:#336699;'></div>");
   document.write("</div>");
   calendar.calendarPad=document.all.divCalendarpad;
  }
  /************** 加入日历面板 *********************/
  this.addCalendarBoard=function(){
   var BOARD=this;
   var divBoard=document.createElement("div");
   calendar.calendarPad.insertAdjacentElement("beforeEnd",divBoard);
   divBoard.style.cssText="position:absolute;top:0;left:0;width:250;height:166;border:1 outset;background-color:buttonface;";