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

HTML/XHTML教程
回答XML与HTML的区别
举一反三 浅谈在网页上显示日期的两种方法
打开“保护之门”—破解网页限制功能
“快马加鞭”—网站浏览提速七种武器
用FAQGenie迅速制作“常见问答”网页
流程图软件Visio作“高难度”网页
动态HTML教程(二)
动态HTML教程(一)
动态HTML教程(三)
Html源文件中image标签的析取
什么是Dynamic HTML
关于CSS中的类-CLASS
什么是CSS?它的能做些什么?
如何将 CSS 加诸于网页
CSS产生的特殊效果
CSS的字体、字型控制
使用不同的CSS写法-CSS进阶
HTML的基本元素
Html的几个小技巧
WEB界面设计五种特征

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-04   浏览: 91 ::
收藏到网摘: 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;";