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

类型日期插件.docx

  • 文档编号:29172973
  • 上传时间:2023-07-21
  • 格式:DOCX
  • 页数:17
  • 大小:20.14KB
");

varWebCalendar=newWebCalendar();

functiondocument.onclick()

{

if(WebCalendar.eventSrc!

=window.event.srcElement)hiddenCalendar();

}

functionWebCalendar()//初始化日历的设置

{

this.regInfo="WEBCalendarver3.0 关闭的快捷键:

[Esc]";

this.dayShow=38;//定义页面上要显示的天数,不能小于35,或大于39

this.daysMonth=newArray(31,28,31,30,31,30,31,31,30,31,30,31);

this.day=newArray(this.dayShow);//定义日历展示用的数组

this.dayObj=newArray(this.dayShow);//定义日期展示控件数组

this.dateStyle=null;//保存格式化后日期数组

this.objExport=null;//日历回传的显示控件

this.eventSrc=null;//日历显示的触发控件

this.inputDate=null;//转化外的输入的日期(d/m/yyyy)

this.thisYear=newDate().getFullYear();//定义年的变量的初始值

this.thisMonth=newDate().getMonth()+1;//定义月的变量的初始值

this.thisDay=newDate().getDate();//定义日的变量的初始值

this.today=this.thisDay+"/"+this.thisMonth+"/"+this.thisYear;//今天(d/m/yyyy)

this.iframe=window.frames("meizzCalendarIframe");//日历的iframe载体

this.calendar=getObjectById("meizzCalendarLayer");//日历的层

this.dateReg="";//日历格式验证的正则式

this.yearFall=50;//定义显示的年份下拉框的年差值,如果今年是2000年,这里设置为50,就显示1950-2050

this.format="yyyy-mm-dd";//回传日期的格式

this.timeShow=false;//是否返回时间

this.drag=true;//是否允许拖动

this.darkColor="#95B7F3";//控件的暗色

this.lightColor="#FFFFFF";//控件的亮色

this.btnBgColor="#E6E6FA";//控件的按钮背景色

this.wordColor="#000080";//控件的文字颜色

this.wordDark="#DCDCDC";//控件的暗文字颜色

this.dayBgColor="#F5F5FA";//日期数字背景色

this.todayColor="#FF0000";//今天在日历上的标示背景色

this.DarkBorder="#D4D0C8";//日期显示的立体表达色

this.yearOption="";

varyearNow=newDate().getFullYear();

yearNow=(yearNow<=1000)?

1000:

((yearNow>=9999)?

9999:

yearNow);

varyearMin=(yearNow-this.yearFall>=1000)?

yearNow-this.yearFall:

1000;

varyearMax=(yearNow+this.yearFall<=9999)?

yearNow+this.yearFall:

9999;

yearMin=(yearMax==9999)?

yearMax-this.yearFall*2:

yearMin;

yearMax=(yearMin==1000)?

yearMin+this.yearFall*2:

yearMax;

for(vari=yearMin;i<=yearMax;i++)this.yearOption+=""+i+"年";

}

functionwriteIframe()

{

varstrIframe="

0px'oncontextmenu='returnfalse'>";

if(WebCalendar.drag){strIframe+=""+

"vardrag=false,cx=0,cy=0,o=parent.WebCalendar.calendar;functiondocument.onmousemove(){"+

"if(parent.WebCalendar.drag&&drag){if(o.style.left=='')o.style.left=0;if(o.style.top=='')o.style.top=0;"+

"o.style.left=parseInt(o.style.left)+window.event.clientX-cx;"+

"o.style.top=parseInt(o.style.top)+window.event.clientY-cy;}}"+

"functiondocument.onkeydown(){switch(window.event.keyCode){case27:

parent.hiddenCalendar();break;"+

"case37:

parent.prevM();break;case38:

parent.prevY();break;case39:

parent.nextM();break;case40:

parent.nextY();break;"+

"case84:

document.forms[0].today.click();break;}"+

"try{window.event.keyCode=0;window.event.returnValue=false;}catch(ee){}}"+

"functiondragStart(){cx=window.event.clientX;cy=window.event.clientY;drag=true;}"}

strIframe+=""+

""+

""+

"

←'style='cursor:

hand'onclick='parent.prevM()'><"+

"

"onmouseover='this.bgColor=parent.WebCalendar.darkColor;this.style.color=parent.WebCalendar.lightColor'"+

"onmouseout='this.bgColor=parent.WebCalendar.lightColor;this.style.color=parent.WebCalendar.wordColor'>"+

"

100%;'"+

"onchange='parent.WebCalendar.thisYear=this.value;parent.hiddenSelect(this);parent.writeCalendar();'>";

//varyearNow=newDate().getFullYear();

//yearNow=(yearNow<=1000)?

1000:

((yearNow>=9999)?

9999:

yearNow);

//varyearMin=(yearNow-WebCalendar.yearFall>=1000)?

yearNow-WebCalendar.yearFall:

1000;

//varyearMax=(yearNow+WebCalendar.yearFall<=9999)?

yearNow+WebCalendar.yearFall:

9999;

//yearMin=(yearMax==9999)?

yearMax-WebCalendar.yearFall*2:

yearMin;

//yearMax=(yearMin==1000)?

yearMin+WebCalendar.yearFall*2:

yearMax;

//for(vari=yearMin;i<=yearMax;i++)strIframe+=""+i+"年";

strIframe+=WebCalendar.yearOption+""+

""+

"

"onmouseover='this.bgColor=parent.WebCalendar.darkColor;this.style.color=parent.WebCalendar.lightColor'"+

"onmouseout='this.bgColor=parent.WebCalendar.lightColor;this.style.color=parent.WebCalendar.wordColor'>"+

"

100%;'"+

"onchange='parent.WebCalendar.thisMonth=this.value;parent.hiddenSelect(this);parent.writeCalendar();'>";

for(vari=1;i<13;i++)strIframe+=""+i+"月";

strIframe+=""+

""+

"

→'onclick='parent.nextM()'style='cursor:

hand'>>"+

""+

"

if(WebCalendar.drag){strIframe+="onmousedown='dragStart()'onmouseup='drag=false'";}

strIframe+="borderColorLight='"+WebCalendar.darkColor+"'borderColorDark='"+WebCalendar.lightColor+"'>"+

"日一二三四五六"+

""+

"";

for(varx=0;x<5;x++){

strIframe+="";

for(vary=0;y<7;y++)

strIframe+="";

strIframe+="";

}

strIframe+="";

for(varx=35;x

strIframe+="";

strIframe+="

center;'title='"+WebCalendar.regInfo+"'>"+

"

"+WebCalendar.btnBgColor+";cursor:

hand;padding-top:

2px;width:

44%;height:

100%;'onfocus='this.blur()'"+

"type=buttonvalue='清空'onclick='parent.WebCalendar.objExport.value=\"\";parent.hiddenCalendar()'>"+

" "+

"

"+WebCalendar.btnBgColor+";cursor:

hand;padding-top:

2px;width:

43%;height:

100%;'onfocus='this.blur()'"+

"type=buttonvalue='关闭'onclick='parent.hiddenCalendar()'>"+

""+

""+

""+

"

↑'onclick='parent.prevY()'type=buttonvalue='<<'"+

"onfocus='this.blur()'style='meizz:

expression(this.disabled=parent.WebCalendar.thisYear==1000)'>

"onfocus='this.blur()'name=prevMonthtitle='向前翻1月 快捷键:

←'onclick='parent.prevM()'type=buttonvalue='< '>"+

"

50px;'title='当前日期 快捷键:

T'"+

"onclick=\"parent.returnDate(newDate().getDate()+'/'+(newDate().getMonth()+1)+'/'+newDate().getFullYear())\">"+

"

→'name=nextMonthonclick='parent.nextM()'type=buttonvalue=' >'"+

"onfocus='this.blur()'>

↓'onclick='parent.nextY()'type=buttonvalue='>>'"+

"onfocus='this.blur()'style='meizz:

expression(this.disabled=parent.WebCalendar.thisYear==9999)'>"+

"

";

with(WebCalendar.iframe)

{

document.writeln(strIframe);document.close();

for(vari=0;i

{

WebCalendar.d

  

配套讲稿:

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

特殊限制:

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

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

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

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

收起
展开