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

HTML/XHTML教程
对联广告代码效果之二[鼠标感应]
对联广告代码效果之三[允许关闭]
禁止右键、Ctrl键和复制功能的JS代码
无刷新变换BANNER特效代码
计算鼠标所在位置的x,y坐标的JavaScript脚本
javascript: 改变和控制显示的图片大小(保持比例,同时可限制高宽)
限制文本输入框只能输入0-9数字
windows.open()参数列表
VBscript超强幻灯片效果代码
模仿MSN消息提示的效果
记录访客的来访次数
自动关闭弹出式窗口
状态栏特效
鼠标右键显隐效果
随鼠标的闪烁小星星
鼠标周围的文字宣传
荧光文字
点一下,首页地址添加到收藏夹
让弹出窗口变得“体贴”一些
如何制作浮动广告

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


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