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

HTML/XHTML教程
Data URI和MHTML完整解决所有浏览器
HTML表格边框的控制实现代码
6个不常用HTML标记使用说明
HTML5 Canvas概述
IE6 空格bug修正方法
w3c组织给出html4的样式建议
IE6下网页制作参考 IE6 默认样式
html标签a的target属性的用法
XHTML+CSS写出正规的BLOG
HTML教程:收集的常用的HTML标签(4)
HTML教程:收集的常用的HTML标签(6)
动态修改框架(frame)src属性的方法
HTML基础:HTML的基本结构
网页制作解惑:图象文件的路径
HTML教程:html水平线段<HR />
HTML表格标记教程(18):表格的表头<TH>
HTML表格标记教程(19):行标记<TR>属性
HTML表格标记教程(26):单元格标记<TD>属性
XHTML教程:针对初学者的XHTML基础
HTML表格标记教程(44):表格的表首标记<THEAD>

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


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

   var tbBoard=document.createElement("table");
   divBoard.insertAdjacentElement("beforeEnd",tbBoard);
   tbBoard.style.cssText="position:absolute;top:0;left:0;width:100%;height:10;font-size:9pt;";
   tbBoard.cellPadding=0;
   tbBoard.cellSpacing=1;
   tbBoard.bgColor="#333333";

  /************** 设置各功能按钮的功能 *********************/
   /*********** Calendar About Button ***************/
   trRow = tbBoard.insertRow(0);
   calendar.calendarAbout=calendar.insertTbCell(trRow,0,"-","center");
   calendar.calendarAbout.onclick=function(){calendar.about();}
   /*********** Calendar Head ***************/
   tbCell=trRow.insertCell(1);
   tbCell.colSpan=5;
   tbCell.bgColor="#99CCFF";
   tbCell.align="center";
   tbCell.style.cssText = "cursor:default";
   calendar.head=tbCell;
   /*********** Calendar Close Button ***************/
   tbCell=trRow.insertCell(2);
   calendar.calendarClose = calendar.insertTbCell(trRow,2,"x","center");
   calendar.calendarClose.title="关闭";
   calendar.calendarClose.onclick=function(){calendar.hide();}

   /*********** Calendar PrevYear Button ***************/
   trRow = tbBoard.insertRow(1);
   calendar.prevYear = calendar.insertTbCell(trRow,0,"&lt;&lt;","center");
   calendar.prevYear.title="上一年";
   calendar.prevYear.onmousedown=function(){
    calendar.currentDate[0]--;
    calendar.show(calendar.target,calendar.currentDate[0]+"-"+calendar.currentDate+"-"+calendar.currentDate,calendar.source);
   }
   /*********** Calendar PrevMonth Button ***************/
   calendar.prevMonth = calendar.insertTbCell(trRow,1,"&lt;","center");
   calendar.prevMonth.title="上一月";
   calendar.prevMonth.onmousedown=function(){