• 全部
  • 问答

可怜西西的性欲又涨回去了,是福是祸?不知道,散个htc日历先

yonghengdizhen 2003-06-02 12:27:42
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="Init()"/>
<PUBLIC:PROPERTY PUT="setDate" NAME="DateValue" />
<PUBLIC:PROPERTY PUT="setYear" NAME="Year" />
<PUBLIC:PROPERTY PUT="setMonth" NAME="Month" />
<PUBLIC:PROPERTY PUT="setDay" NAME="Day" />
<PUBLIC:PROPERTY PUT="setRowHeight" NAME="RowHeight" />
<PUBLIC:PROPERTY PUT="setCellWidth" NAME="CellWidth" />
<PUBLIC:PROPERTY GET="getDate" NAME="DateValue" />
<PUBLIC:PROPERTY PUT="setDateFormat" NAME="DateFormat" />
<PUBLIC:EVENT NAME="ondatechange" ID="eventID" />
<PUBLIC:ATTACH EVENT="ondatechange" ONEVENT="ResetDateTable()"/>
<SCRIPT LANGUAGE="javascript">
var cl_dpMaxYear=9999;
var cl_dpMaxMonth=11;
var cl_dpMaxDay=31;
var cl_dpMinYear=1600;
var cl_dpMinMonth=0;
var cl_dpMinDay=1;
var cl_dpRowHeight=19;
var cl_dpCellWidth=46;
var oDatePicker;
var oDateObject=new Date();
var oOldDateObject=new Date();
var oYearInput;
var oMonthInput;
var oDayInput;
var oDateTable;
var oEvent;
var vt_dpFormat="yyyy/mm/dd";

///////////////////////////////////////////////////////////////////////////////////
///////////////////////HTC版日历,适用于IE 5.0以上版浏览器//////////////////////////
//为了使下拉日历表正确定位,请将绑定元素使用独立容器存放,例如使用两个不同的单元格///
///////////////////////////////////////////////////////////////////////////////////
function ResetDateTable()
{
//注意,此处不能再次调用设置绑定对象的任何方法,否则产生事件递归触发导致堆栈溢出
//此事件也可放在被绑定元素的HTML中触发.
//lStep=event.result;
}
function setDate(vValue)
{
dt=date_getDateFromVT_DATE(vValue);
if(dt!=null){oDateObject=dt;}
}
function setYear(vValue)
{
if(!isNaN(vValue))
{
if(oDateObject.getFullYear()!=parseInt(vValue))
{
oDateObject.setFullYear(vValue);
window.frames[theName].CurrentDate=oDateObject.clone();
window.frames[theName].dp_initDropDown();
dp_onDateChange();
}
}
}
function setMonth(vValue)
{
if(!isNaN(vValue))
{
if(oDateObject.getMonth()!=parseInt(vValue))
{
oDateObject.setMonth(vValue);
window.frames[theName].CurrentDate=oDateObject.clone();
window.frames[theName].dp_initDropDown();
dp_onDateChange();
}
}
}
function setDay(vValue)
{
if(!isNaN(vValue))
{
if(oDateObject.getDate()!=parseInt(vValue))
{
oDateObject.setDate(vValue);
window.frames[theName].CurrentDate=oDateObject.clone();
window.frames[theName].dp_initDropDown();
dp_onDateChange();
}
}
}
function setDateFormat(vValue)
{
if(vValue!="")
{
vt_dpFormat=vValue;
}
}
function setRowHeight(vValue)
{
if(!isNaN(vValue))
{
cl_dpRowHeight=vValue;
}
}
function setCellWidth(vValue)
{
if(!isNaN(vValue))
{
cl_dpCellWidth=vValue;
}
}
function getDate()
{
return oDateObject;
}
//公用函数开始
function KeyFilter(type)
{
var berr=false;
switch(type)
{
case 'date':
if (!(event.keyCode == 45 || event.keyCode == 47 || (event.keyCode>=48 && event.keyCode<=57)))
berr=true;
break;
case 'number':
if (!(event.keyCode>=48 && event.keyCode<=57))
berr=true;
break;
case 'cy':
if (!(event.keyCode == 46 || (event.keyCode>=48 && event.keyCode<=57)))
berr=true;
break;
case 'long':
if (!(event.keyCode == 45 || (event.keyCode>=48 && event.keyCode<=57)))
berr=true;
break;
case 'double':
if (!(event.keyCode == 45 || event.keyCode == 46 || (event.keyCode>=48 && event.keyCode<=57)))
berr=true;
break;
default:
if (event.keyCode == 35 || event.keyCode == 37 || event.keyCode==38)
berr=true;
}
event.returnValue=!berr;
}
function getOffsetLeft(src)
{
var set=0;
if(src)
{
if (src.offsetParent)
set+=src.offsetLeft+getOffsetLeft(src.offsetParent);

if(src.tagName!="BODY")
{
var x=parseInt(src.scrollLeft,10);
if(!isNaN(x))
set-=x;
}
}
return set;
}
function getOffsetTop(src)
{
var set=0;
if(src)
{
if (src.offsetParent)
set+=src.offsetTop+getOffsetTop(src.offsetParent);

if(src.tagName!="BODY")
{
var y=parseInt(src.scrollTop,10);
if(!isNaN(y))
set-=y;
}
}
return set;
}
//////////////////////
//日期类扩展函数开始//
function date_format(sFormat)
{
var dt=this;
if(sFormat==null || typeof(sFormat)!="string")
sFormat="";
sFormat=sFormat.replace(/yyyy/ig,dt.getFullYear());
var y=""+dt.getYear();
if(y.length>2)
{
y=y.substring(y.length-2,y.length);
}
sFormat=sFormat.replace(/yy/ig,y);
sFormat=sFormat.replace(/mm/ig,dt.getMonth()+1);
sFormat=sFormat.replace(/dd/ig,dt.getDate());
return sFormat;
}
function date_clone()
{
return new Date(this.getFullYear(),this.getMonth(),this.getDate());
}
function date_compare(dtCompare)
{
var dt=this;
var hr=0;
if(dt && dtCompare)
{
if(dt.getFullYear()>dtCompare.getFullYear())
hr=1;
else if(dt.getFullYear()<dtCompare.getFullYear())
hr=-1;
else if(dt.getMonth()>dtCompare.getMonth())
hr=1;
else if(dt.getMonth()<dtCompare.getMonth())
hr=-1;
else if(dt.getDate()>dtCompare.getDate())
hr=1;
else if(dt.getDate()<dtCompare.getDate())
hr=-1;
}
return hr;
}
function date_getDateFromVT_DATE(dt)
{
dt=dt.replace(/-/g,"/");
dt=Date.parse(dt);
if(isNaN(dt))
dt=null;
else
dt=new Date(dt);
return dt;
}
function initDateObject()
{
Date.prototype.compare=date_compare;
Date.prototype.clone=date_clone;
Date.prototype.format=date_format;
}
//日期类扩展函数结束//
//////////////////////
////////////////
//日历函数开始//
function dp_getValidDate(lYear,lMonth,lDay)
{
var dt=new Date();
if(lYear==null || isNaN(parseInt(lYear,10)))
lYear=dt.getFullYear();
else
lYear=parseInt(lYear,10);
if(lMonth==null || isNaN(parseInt(lMonth,10)))
lMonth=dt.getMonth();
else
lMonth=parseInt(lMonth,10)-1;
if(lDay==null || isNaN(parseInt(lDay,10)))
lDay=dt.getDate();
else
lDay=parseInt(lDay,10);
dt=new Date(lYear,lMonth,lDay);
var cdMax=new Date(cl_dpMaxYear,cl_dpMaxMonth,cl_dpMaxDay);
var cdMin=new Date(cl_dpMinYear,cl_dpMinMonth,cl_dpMinDay);
if(dt.compare(cdMax)>0 || dt.compare(cdMin)<0)
dt=null;
return dt;
}
function dp_onDateChange()
{
//var lStep=oDateObject.compare(oOldDateObject);
//if(lStep!=0)
//{
//oOldDateObject=oDateObject.clone();
dp_refreshView();
element.value=oDateObject.format(vt_dpFormat);
oEvent=createEventObject();
//oEvent.result=lStep;
eventID.fire(oEvent);
//}
}

function dp_refreshView()
{
var hr=false;
if(oDateObject!=null)
{
oYearInput.value=oDateObject.getFullYear();
oMonthInput.value=oDateObject.getMonth()+1;
oDayInput.value=oDateObject.getDate();
hr=true;
}
return hr;
}
function dp_setCurDate(lYear,lMonth,lDay)
{
var hr=false;
lYear=parseInt(lYear,10);
lMonth=parseInt(lMonth,10);
lDay=parseInt(lDay,10);
if(!(isNaN(lYear) || isNaN(lMonth) || isNaN(lDay)))
{
var dt=new Date(lYear,lMonth-1,lDay);
var dMax=new Date(cl_dpMaxYear,cl_dpMaxMonth,cl_dpMaxDay);
var dMin=new Date(cl_dpMinYear,cl_dpMinMonth,cl_dpMinDay);
if(dt.compare(dMax)<=0 && dt.compare(dMin)>=0)
{
oDateObject=dt;
window.frames[theName].CurrentDate=oDateObject.clone();
window.frames[theName].dp_initDropDown();
dp_onDateChange();
hr=true;
}
}
if(!hr)
dp_refreshView();
return hr;
}
//日历函数结束//
////////////////
...全文
28 点赞 收藏 25
写回复
25 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
luxuezhu 2003-07-31
mark
回复
yonghengdizhen 2003-06-10
to runmin(拒用GOOGLE中...)
这个我也发现了.
不过我在win98下的ie5 用起来感觉还挺好.不知道是什么原因,在win2K+ie6反而不爽了.你要是有兴趣,找到优化的方法不妨讨论一下
回复
runmin 2003-06-10
有点慢啊
回复
DemonLeo 2003-06-10
致敬!
回复
liuqinyi 2003-06-10
这么爽的东西,我收!
回复
zhuyngjie 2003-06-10
学习
回复
nik_Amis 2003-06-10
up
回复
sandyuk 2003-06-09

very good!
回复
jsidiot 2003-06-08
这么长阿。呵呵
回复
demo010 2003-06-08
good!!
回复
online 2003-06-08
呵呵
回复
hyafer 2003-06-07
学习
回复
Keyln 2003-06-07
studying..........
回复
潇洒 2003-06-07
还是 htc 方便...... 可惜只有 IE 支持?
回复
microlin 2003-06-02
哇,那个日历代码太长了吧,不好减肥减肥?
回复
Foreverness 2003-06-02
为了挣几个血汗分.偶只好两个马甲轮着上了. :<<<

A.button
{
COLOR: black;
FONT-FAMILY: ??ì?;
FONT-SIZE: 11px;
FONT-WEIGHT: bold
}
A.button:hover
{
COLOR: orangered;
TEXT-DECORATION: none
}
A.button:visited
{
COLOR: royalblue;
TEXT-DECORATION: none
}
BODY
{
BACKGROUND-IMAGE: url(../images/main_bg.jpg);
BACKGROUND-REPEAT: repeat;
FONT-FAMILY: ??¨??;
FONT-SIZE: 12px
}
A
{
COLOR: royalblue;
FONT-WEIGHT: bold;
TEXT-DECORATION: none
}
A:hover
{
COLOR: chocolate;
FONT-WEIGHT: bold;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: royalblue
}
SELECT
{
FONT-FAMILY: ??¨??, Verdana, Tahoma, Arial, Geneva;
FONT-SIZE: 12px;
font-color: black
}
TEXTAREA
{
FONT-FAMILY: ??¨??, Verdana, Tahoma, Arial, Geneva;
FONT-SIZE: 12px;
font-color: black
}
INPUT
{
FONT-FAMILY: ??¨??, Verdana, Tahoma, Arial, Geneva;
FONT-SIZE: 12px;
font-color: black
}
TD
{
FONT-FAMILY: ??¨??, Verdana, Tahoma, Arial, Geneva;
FONT-SIZE: 12px;
font-color: black
}
TR
{
BORDER-BOTTOM: mediumaquamarine;
BORDER-LEFT: mediumaquamarine;
BORDER-RIGHT: mediumaquamarine;
BORDER-TOP: mediumaquamarine;
COLOR: black;
FONT-FAMILY: ??¨??, Verdana, Tahoma, Arial, Geneva;
FONT-SIZE: 12px;
font-color: black
}
TH
{
COLOR: black;
FONT-FAMILY: ??¨??;
FONT-SIZE: 13px;
HEIGHT: 16px;
font-color: #003466
}
BUTTON
{
BACKGROUND-COLOR: lightblue;
COLOR: midnightblue
}
CODE
{
FONT-FAMILY: ??¨??, Verdana, Tahoma, Arial, Geneva;
FONT-SIZE: 12px;
FONT-WEIGHT: bold;
font-color: black
}
A:active
{
COLOR: royalblue
}
TABLE
{
FONT-SIZE: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-RIGHT: 0px;
PADDING-BOTTOM: 0px;
PADDING-LEFT: 0px;
PADDING-RIGHT: 0px;
PADDING-TOP: 0px
}
TR.title
{
BACKGROUND-COLOR: #97b6ff;
COLOR: white;
FONT-WEIGHT: bolder;
HEIGHT: 14pt;
TEXT-ALIGN: left
}
TD.conntent
{
COLOR: #006f6f
}
TD.caption
{
BACKGROUND-COLOR: lavender;
COLOR: black;
FONT-WEIGHT: bolder;
TEXT-ALIGN: left
}
HTML
{
BACKGROUND-COLOR: transparent;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
WIDTH: 200px
}
#dpDropDownTable
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 1px solid;
BORDER-LEFT: 1px solid;
BORDER-RIGHT: 1px solid;
BORDER-TOP: 1px solid;
CURSOR: default;
DISPLAY: none;
POSITION: absolute
}
.DPTitle
{
BACKGROUND-COLOR: #c9f1f1;
COLOR: #000000;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
TEXT-ALIGN: center
}
.DPWeekName
{
BORDER-BOTTOM: black 1px solid;
COLOR: #00008b;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
TEXT-ALIGN: center
}
.DPCellOther
{
COLOR: silver;
CURSOR: hand;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
TEXT-ALIGN: center;
WIDTH: 10pt
}
.DPCell
{
COLOR: #00008b;
CURSOR: hand;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
TEXT-ALIGN: center;
WIDTH: 20pt
}
.DPCellSelect
{
BACKGROUND-COLOR: #ffa07a;
COLOR: #000000;
CURSOR: hand;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
TEXT-ALIGN: center;
WIDTH: 10pt
}
.DPYear
{
BACKGROUND-COLOR: transparent;
BORDER-BOTTOM: 1px;
BORDER-LEFT: 1px;
BORDER-RIGHT: 1px;
BORDER-TOP: 1px;
COLOR: blue;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
TEXT-ALIGN: right
}
.DPYearDes
{
BACKGROUND-COLOR: transparent
}
.DPMonth
{
BACKGROUND-COLOR: transparent;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: blue;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
TEXT-ALIGN: right
}
.DPMonthDes
{
BACKGROUND-COLOR: transparent;
WIDTH: 10pt
}
.DPDay
{
BACKGROUND-COLOR: transparent;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: blue;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
TEXT-ALIGN: right
}
.DPDayDes
{
BACKGROUND-COLOR: transparent;
WIDTH: 10pt
}
.DPSep
{
BACKGROUND-COLOR: transparent;
WIDTH: 10px
}
A.DPDropBtn:link
{
COLOR: blue;
TEXT-DECORATION: none
}
A.DPDropBtn:visited
{
COLOR: #000000;
TEXT-DECORATION: none
}
A.DPDropBtn:hover
{
COLOR: blue;
TEXT-DECORATION: none
}
.DPBtn
{
BACKGROUND-COLOR: lightblue;
BORDER-BOTTOM: salmon 1px solid;
BORDER-LEFT: medium none;
BORDER-TOP: white 1px solid;
COLOR: black;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-VARIANT: normal;
FONT-WEIGHT: normal;
LINE-HEIGHT: normal;
WIDTH: 36px
}
TABLE
{
WIDTH: 240pt
}
TD.head
{
COLOR: black;
FONT-WEIGHT: bolder
}
回复
CRuntimeClass 2003-06-02
测试页
<STYLE>
.DatePicker {behavior:url(DATE_PICKER.HTC)}
</STYLE>
<table border=1>
<tr>
<td>
<INPUT id=xx class="DatePicker" type=text DateValue="1999/09/09" ondatechange="//alert('value chaged')">
</td>
<td>
<INPUT id=xx class="DatePicker " type=hidden DateValue="1999/09/09" ondatechange="//alert('value chaged')">
</td>
</tr>
</table>
<iframe name=test src="about:blank" height=100 widht=200></iframe>
回复
yonghengdizhen 2003-06-02
sHTML="<link rel=stylesheet type='text/css' href='DatePicker.css'>"
sHTML+="<SCRIPT language=javascript>"
sHTML+="var BindingObject=parent.document.all('" + element.uniqueID +"');"
sHTML+="var oDateTable=parent.document.all('" + oDateTable.uniqueID +"');"
sHTML+="var CurrentDate=new Date(BindingObject.value);"
sHTML+="var curCell=null;"
sHTML+="function InitIframe()"
sHTML+="{"
sHTML+=" {"
sHTML+=" parent.document.all('" + theName + "').height=parseInt(document.body.scrollHeight)+5;"
sHTML+=" parent.document.all('" + theName + "').width=parseInt(document.body.scrollWidth)+5;"
sHTML+=" }"
sHTML+="};"
sHTML+=dp_getMonthName.toString() + ";";
sHTML+=dp_showDataTable.toString() + ";";
sHTML+="function dp_initDropDown()"
sHTML+="{"
sHTML+=" var ddt=document.all.DateTable;"
sHTML+=" var cell=null;"
sHTML+=" var dt=new Date(CurrentDate.getFullYear(),CurrentDate.getMonth(),1);"
sHTML+=" cell=ddt.rows[0].cells[1];"
sHTML+=" if(cell)"
sHTML+=" {"
sHTML+=" cell.innerText=dp_getMonthName(dt.getMonth())+' '+dt.getFullYear();"
sHTML+=" }"
sHTML+=" var wd=dt.getDay();"
sHTML+=" dt=new Date(dt.getFullYear(),dt.getMonth(),1-wd);"
sHTML+=" var day=dt.getDate();"
sHTML+=" for(var i=2; i<8; i++)"
sHTML+=" {"
sHTML+=" for(var j=0; j<7; j++)"
sHTML+=" {"
sHTML+=" cell=ddt.rows[i].cells[j];"
sHTML+=" if(cell)"
sHTML+=" {"
sHTML+=" if(dt.getMonth()!=CurrentDate.getMonth())"
sHTML+=" {"
sHTML+=" _className='DPCellOther'"
sHTML+=" }"
sHTML+=" else"
sHTML+=" {"
sHTML+=" _className='DPCell'"
sHTML+=" }"
sHTML+=" cell.className=_className;"
sHTML+=" if(dt.valueOf()==CurrentDate.valueOf())"
sHTML+=" {"
sHTML+=" sHTML='<fieldset style=background-color:7777e8;cursor:hand;font-weight:800>' + day + '<fieldset>';"
sHTML+=" }"
sHTML+=" else"
sHTML+=" {"
sHTML+=" sHTML=day;"
sHTML+=" }"
sHTML+=" cell.innerHTML=sHTML;"
sHTML+=" cell.year=dt.getFullYear();"
sHTML+=" cell.month=dt.getMonth();"
sHTML+=" dt.setDate(day+1);"
sHTML+=" day=dt.getDate();"
sHTML+=" }"
sHTML+=" }"
sHTML+=" }"
sHTML+="};"
sHTML+="function dp_monthChange(lStep)"
sHTML+="{"
sHTML+=" var dt=BindingObject;"
sHTML+=" var odt=new Date(BindingObject.value);"
sHTML+=" var lOldMonth=odt.getMonth();"
sHTML+=" var lOldDay=odt.getDate();"
sHTML+=" dt.Day=1;"
sHTML+=" dt.Month=lOldMonth+lStep+1;"
sHTML+=" dt.Day=0;"
sHTML+=" var ndt=new Date(BindingObject.value);"
sHTML+=" if(ndt.getDate()>lOldDay)"
sHTML+=" dt.Day=lOldDay;"
sHTML+=" CurrentDate=new Date(BindingObject.value);"
sHTML+= " dp_initDropDown();"
sHTML+="};"
sHTML+="function dp_ddt_click()"
sHTML+="{"
sHTML+=" BindingObject.Year=event.srcElement.year;"
sHTML+=" BindingObject.Month=event.srcElement.Month;"
sHTML+=" BindingObject.Day=event.srcElement.innerText;"
sHTML+=" dp_showDataTable();"
sHTML+="};"
sHTML+="function dp_ddt_dblclick()"
sHTML+="{"
sHTML+=" dp_showDataTable();"
sHTML+="};"
sHTML+="<" + "/SCRIPT>"
sHTML+="<BODY scroll=no bgcolor='' bottomMargin=0 topMargin=0 leftMargin=0 rightMargin=0>"
sHTML+="<FIELDSET style='border-color:red;border-style:inset'>"
sHTML+="<TABLE style='table-layout:fixed' cellspacing=0 cellpadding=0 id=DateTable class=clock onclick=dp_ddt_click() ondblclick=dp_ddt_dblclick()>"
for(i=0;i<7;i++)
{
sHTML+="<COL width=" + (cl_dpCellWidth-2) + ">"
}
sHTML+="<TR class=DPTitle height=" + cl_dpRowHeight + ">"
sHTML+="<TD align=center class=DPBtn style='padding-right:0;cursor:hand;' onclick=dp_monthChange(-1) title=上月>《</TD>"
var dt=oDateObject.clone();
var wd=dt.getDay();
dt=new Date(dt.getFullYear(),dt.getMonth(),1-wd);
sHTML+="<TD align=center colspan=5>" + dp_getMonthName(oDateObject.getMonth()) + " " + oDateObject.getFullYear() + "</TD>"
sHTML+="<TD align=center class=DPBtn style='cursor:hand;' onclick=dp_monthChange(1) title=下月>》</TD>"
sHTML+="</TR>"
sHTML+="<TR height=" + (cl_dpRowHeight) + ">"
sHTML+="<TD class=DPWeekName>日</TD>"
sHTML+="<TD class=DPWeekName>一</TD>"
sHTML+="<TD class=DPWeekName>二</TD>"
sHTML+="<TD class=DPWeekName>三</TD>"
sHTML+="<TD class=DPWeekName>四</TD>"
sHTML+="<TD class=DPWeekName>五</TD>"
sHTML+="<TD class=DPWeekName>六</TD>"
sHTML+="</TR>"
var day=dt.getDate();
for(i=0;i<6;i++)
{
sHTML+="<TR height=" + cl_dpRowHeight + ">"
for(j=0;j<7;j++)
{
sColor="";
if(dt.getMonth()!=oDateObject.getMonth())
{
_className="DPCellOther"
}
else
{
_className="DPCell";
}
sHTML+="<TD class=" + _className + sColor + " align=center year='" + dt.getFullYear() + "' month='" + dt.getMonth() + "'>"
if(dt.valueOf()==oDateObject.valueOf())
{
sHTML+="<fieldset style='background-color:7777e8;cursor:hand;font-weight:800'>" + day + "</fieldset>";
}
else
{
sHTML+=day;
}
sHTML+="</TD>";
dt.setDate(day+1);
day=dt.getDate();
}
sHTML+="</TR>"
}
sHTML+="</TABLE>"
sHTML+="</FIELDSET>"
sHTML+="</BODY>"
window.frames[theName].document.write(sHTML);
}
</SCRIPT>
</PUBLIC:COMPONENT>
回复
yonghengdizhen 2003-06-02
function Init()
{
initDateObject();
element.readOnly=true;
element.value=oDateObject.format(vt_dpFormat);
oDatePicker=this.document.createElement("span");
oDatePicker.className="DPFrame";
oDatePicker.id=oDatePicker.uniqueID;
oDatePicker=element.parentNode.appendChild(oDatePicker);
oYearInput=element.document.createElement("input");
oYearInput.className="DPYear";
oYearInput.size=4;
oYearInput.maxLength=4;
oYearInput.value=oDateObject.getFullYear();
oYearInput.disabled=element.disabled;
oYearInput.attachEvent('onkeypress',new Function("KeyFilter('number')"));
oYearInput.attachEvent('onkeydown',new Function("dp_keyDown('year')"));
oYearInput.attachEvent('onfocus',new Function("dp_focus('year')"));
oYearInput.attachEvent('onblur',new Function("dp_blur('year')"));
oDatePicker.appendChild(oYearInput);
oYear=element.document.createElement("font");
oYear.className="DPYearDes";
oYear.innerText="年";
oDatePicker.appendChild(oYear);
oMonthInput=this.document.createElement("input");
oMonthInput.className="DPMonth";
oMonthInput.size=2;
oMonthInput.maxLength=2;
oMonthInput.value=oDateObject.getMonth()+1;
oMonthInput.disabled=element.disabled;
oMonthInput.attachEvent('onkeypress',new Function("KeyFilter('number')"));
oMonthInput.attachEvent('onkeydown',new Function("dp_keyDown('month')"));
oMonthInput.attachEvent('onfocus',new Function("dp_focus('month')"));
oMonthInput.attachEvent('onblur',new Function("dp_blur('month')"));
oDatePicker.appendChild(oMonthInput);
oMonth=element.document.createElement("font");
oMonth.className="DPMonthDes";
oMonth.innerText="月";
oDatePicker.appendChild(oMonth);
oDayInput=this.document.createElement("input");
oDayInput.className="DPDay";
oDayInput.size=2;
oDayInput.maxLength=2;
oDayInput.value=oDateObject.getDate();
oDayInput.disabled=element.disabled;
oDayInput.attachEvent('onkeypress',new Function("KeyFilter('number')"));
oDayInput.attachEvent('onkeydown',new Function("dp_keyDown('day')"));
oDayInput.attachEvent('onfocus',new Function("dp_focus('day')"));
oDayInput.attachEvent('onblur',new Function("dp_blur('day')"));
oDatePicker.appendChild(oDayInput);
oDay=element.document.createElement("font");
oDay.className="DPDayDes";
oDay.innerText="日";
oDatePicker.appendChild(oDay);
oSelectSapn=this.document.createElement("font");
oSelectSapn.className="DPSep"
oDatePicker.appendChild(oSelectSapn);
oDateSelect=this.document.createElement("A");
oDateSelect.className="DPDropBtn";
oDateSelect.href="javascript:void(0)";
oDateSelect.size=12;
oDateSelect.innerText="▼";
oDateSelect.attachEvent('onclick',new Function('dp_showDataTable()'));
oDatePicker.appendChild(oDateSelect);
oDateTable=this.document.createElement("div");
oDateTable=oDatePicker.appendChild(oDateTable);
oDateTable.style.position="absolute";
oDateTable.style.display="none";
oDateIframe=element.document.createElement("iframe");
oDateIframe=oDateTable.appendChild(oDateIframe);
theName=oDateIframe.uniqueID;
sHTML="<iframe frameBorder=0 width=" + (cl_dpCellWidth * 7 + 2) + " height=" + (cl_dpRowHeight * 8 + 4);
sHTML+=" marginheight=0 marginwidth=0 hspace=0 vspace=0 scrolling=no";
sHTML+=" name=" + theName +" src='about:blank'></iframe>";
oDateIframe.outerHTML=sHTML;
回复
yonghengdizhen 2003-06-02
//日历事件处理开始//
function dp_keyDown(srcType)
{
var bRefresh=true;
var lYear=oDateObject.getFullYear();
var lMonth=oDateObject.getMonth();
var lDay=oDateObject.getDate();
var lStep=0;
switch(event.keyCode)
{
case 38:
lStep=1;
break;
case 40:
lStep=-1;
break;
case 13:
event.keyCode=9;
break;
default:
bRefresh=false;
}
switch(srcType)
{
case 'year':
lYear+=lStep;
break;
case 'month':
lMonth+=lStep;
break;
case 'day':
lDay+=lStep;
break;
default:;
}
if(bRefresh)
dp_setCurDate(lYear,lMonth+1,lDay);
event.returnValue=true;
}
function dp_focus(srcType)
{
switch(srcType)
{
case 'year':
break;
case 'month':
break;
case 'day':
break;
default:;
}
event.srcElement.select();
event.returnValue=true;
}
function dp_blur(srcType)
{
var lYear=oDateObject.getFullYear();
var lMonth=oDateObject.getMonth()+1;
var lDay=oDateObject.getDate();
var val=parseInt(event.srcElement.value,10);
if(isNaN(val))
val=-1;
switch(srcType)
{
case 'year':
lYear=val==-1?lYear:val;
break;
case 'month':
lMonth=val==-1?lMonth:val;
break;
case 'day':
lDay=val==-1?lDay:val;
break;
default:;
}
dp_setCurDate(lYear,lMonth,lDay);
if(val==-1)
dp_refreshView();
return true;
}
//日历事件处理结束//
////////////////////
function dp_getMonthName(lMonth)
{
var mnArr=new Array('一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月');
return mnArr[lMonth];
};
function dp_showDataTable()
{
if(oDateTable.style.display=="block")
{
if((event.srcElement.tagName=="TD"
&&(event.srcElement.className=='DPCell'||event.srcElement.className=='DPCellOther'))
||event.srcElement.tagName=="A")
{
oDateTable.style.display="none";
}
}
else if(oDateTable.style.display=="none")
{
if(event.srcElement.tagName=="A")
{
oDateTable.style.left=getOffsetLeft(this)+parseInt(this.offsetWidth/2);
oDateTable.style.top=getOffsetTop(this)+this.offsetHeight+10;
}
oDateTable.style.display="block";
}
}
//共用函数结束

回复
相关推荐
发帖
JavaScript
创建于2007-09-28

8.5w+

社区成员

Web 开发 JavaScript
申请成为版主
帖子事件
创建了帖子
2003-06-02 12:27
社区公告
暂无公告