书签 分享 收藏 举报 版权申诉 / 22

类型带时间的日期控件js.docx

  • 文档编号:3402099
  • 上传时间:2022-11-22
  • 格式:DOCX
  • 页数:22
  • 大小:21.62KB
';

window.frames.endDateLayer.document.writeln(strFrame);

window.frames.endDateLayer.document.close();//解决ie进度条不结束的问题

 

//====================================================WEB页面显示部分======================================================

varoutObject;

varoutButton;//点击的按钮

varoutDate="";//存放对象的日期

varbUseTime=false;//是否使用时间

varodatelayer=window.frames.endDateLayer.document.all;//存放日历对象

varodatelayer=window.endDateLayer.document.all;

//odatelayer.bUseTimeLayer.innerText="NO";

bImgSwitch();

odatelayer.bUseTimeLayer.innerHTML=bImg;

functionsetday(tt,obj)//主调函数

{

if(arguments.length>2){alert("对不起!

传入本控件的参数太多!

");return;}

if(arguments.length==0){alert("对不起!

您没有传回本控件任何参数!

");return;}

vardads=document.all.endDateLayer.style;

varth=tt;

varttop=tt.offsetTop;//TT控件的定位点高

varthei=tt.clientHeight;//TT控件本身的高

vartleft=tt.offsetLeft;//TT控件的定位点宽

varttyp=tt.type;//TT控件的类型

while(tt=tt.offsetParent){ttop+=tt.offsetTop;tleft+=tt.offsetLeft;}

dads.top=(ttyp=="image")?

ttop+thei:

ttop+thei+6;

dads.left=tleft;

outObject=(arguments.length==1)?

th:

obj;

outButton=(arguments.length==1)?

null:

th;//设定外部点击的按钮

//根据当前输入框的日期显示日历的年月

varreg=/^(\d+)-(\d{1,2})-(\d{1,2})/;//不含时间

varr=outObject.value.match(reg);

if(r!

=null){

r[2]=r[2]-1;

vard=newDate(r[1],r[2],r[3]);

if(d.getFullYear()==r[1]&&d.getMonth()==r[2]&&d.getDate()==r[3]){

outDate=d;

parent.meizzTheYear=r[1];

parent.meizzTheMonth=r[2];

parent.meizzTheDate=r[3];

}

else{

outDate="";

}

meizzSetDay(r[1],r[2]+1);

}

else{

outDate="";

meizzSetDay(newDate().getFullYear(),newDate().getMonth()+1);

}

dads.display='';

//判断初始化时是否使用时间,非严格验证

//if(outObject.value.length>10)

//{

bUseTime=true;

bImgSwitch();

odatelayer.bUseTimeLayer.innerHTML=bImg;

meizzWriteHead(meizzTheYear,meizzTheMonth);

//}

//else

//{

//bUseTime=false;

//bImgSwitch();

//odatelayer.bUseTimeLayer.innerHTML=bImg;

//meizzWriteHead(meizzTheYear,meizzTheMonth);

//}

try{

event.returnValue=false;

}

catch(e){

//此处排除错误,错误原因暂未找到。

}

}

varMonHead=newArray(12);//定义阳历中每个月的最大天数

MonHead[0]=

配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
时间 日期 控件 js
提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:带时间的日期控件js.docx
链接地址:https://www.bdocx.com/doc/3402099.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2022 冰点文档网站版权所有

经营许可证编号:鄂ICP备2022015515号-1

收起
展开