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

HTML/XHTML教程
表格边框的css语法整理
超文标记语言简明导引
如何将 CSS 加入网页
CSS技术在网页设计中的运用
css 新手上路
网页特效大公开
CSS重新定义项目符号和编号
中文网页制作中段落缩进的方法
制作虚线效果的水平线
初步了解CSS3
CSS滤镜:概述
CSS定位二:空间定位
CSS滤镜:Gray属性
CSS属性(颜色背景属性)
CSS属性(字体属性)
CSS定位一:动态转换
CSS属性(文本属性)
CSS属性("容器"属性)
CSS属性(分级属性)
CSS属性(鼠标属性)

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


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

    calendar.currentDate--;
    if(calendar.currentDate==0){
     calendar.currentDate=12;
     calendar.currentDate[0]--;
    }
    calendar.show(calendar.target,calendar.currentDate[0]+"-"+calendar.currentDate+"-"+calendar.currentDate,calendar.source);
   }
   /*********** Calendar Today Button ***************/
   calendar.goToday = calendar.insertTbCell(trRow,2,"今天","center",3);
   calendar.goToday.title="选择今天";
   calendar.goToday.onclick=function(){
    calendar.sltDate=calendar.currentDate[0]+"-"+calendar.currentDate+"-"+calendar.currentDate;
    calendar.target.value=calendar.sltDate;
    calendar.hide();
    //calendar.show(calendar.target,calendar.today[0]+"-"+calendar.today+"-"+calendar.today,calendar.source);
   }
   /*********** Calendar NextMonth Button ***************/
   calendar.nextMonth = calendar.insertTbCell(trRow,3,">","center");
   calendar.nextMonth.title="下一";
   calendar.nextMonth.onmousedown=function(){
    calendar.currentDate++;
    if(calendar.currentDate==13){
     calendar.currentDate=1;
     calendar.currentDate[0]++;
    }
    calendar.show(calendar.target,calendar.currentDate[0]+"-"+calendar.currentDate+"-"+calendar.currentDate,calendar.source);
   }
   /*********** Calendar NextYear Button ***************/
   calendar.nextYear = calendar.insertTbCell(trRow,4,">>","center");
   calendar.nextYear.title="下一年";
   calendar.nextYear.onmousedown=function(){
    calendar.currentDate[0]++;
    calendar.show(calendar.target,calendar.currentDate[0]+"-"+calendar.currentDate+"-"+calendar.currentDate,calendar.source);