簡單的日曆控制項

2021-08-30 14:31:24 字數 1557 閱讀 3189

//author=zheyiw 

//date=23/7/2009

//使用舉例: onclick="showcalendar(inputbox,outputbox)"

// inputbox是按鈕控制項 outputbox是日期輸出的文字框

//學習用正好,要找完整的還是walkingpoison那個版本吧。

//定義一塊區域

"");

document.writeln("

");

'');

//輸出資料變數

var outputdata;

//確定日曆位置,顯示當前日期

function showcalendar(inputbox,outputbox)

document.getelementbyid("calendar").style.left=x+2+"px";

document.getelementbyid("calendar").style.top=y+20+"px";

document.getelementbyid("calendar").style.visibility="visible";

var objdate=new date();

maincalendar(objdate.getyear(),objdate.getmonth(),objdate.getdate());

} //繪製日曆

function maincalendar(year,month,day)

//else if(dd==number(objdate.getdate()))

else

d++;

} divcontent+="";

} divcontent+="";

//在區域中插入html

document.getelementbyid("calendar").innerhtml=divcontent;

// newcalendar();

} //月份減少

function monthmin(year,month,day)

else

document.getelementbyid("calendar").innerhtml=divcontent;

maincalendar(year,month,day);

} //月份增加

function monthadd(year,month,day)

else

document.getelementbyid("calendar").innerhtml=divcontent;

maincalendar(year,month,day);

} //滑鼠經過

function mouseover(obj)

//滑鼠離開

function mouseout(obj)

//輸出資料

function outdata(obj,year,month)

乙個簡單的日曆控制項

效果圖 var defaultdate new date var startyear,startmonth,startday 變數定義需要改一下,用default來定義當天的所有資訊 不能改變 var defaultmonth defaultdate.getmonth var defaultyear...

日曆使用者控制項

namespace tempweb remove private static readonly string header new string private datetime startdate gets or sets the show date.the show date.descript...

日曆控制項 Calendar

現在我們可以利用calendar控制項可以簡單的實現乙個很好的日曆控制項.直接在工具箱裡面拉出來就可以了,在這個控制項裡面,我們也可以做更多的個性化.有系統預設的也有系統自己帶的很多款式給你選擇.當然你不高興的話可以自己選擇自己的方式去填充這些 我選擇了乙個專業型的.感覺還不錯.呵呵 asp cal...