代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script>
var myC_x,myC_y;
var myC_timeset=null,myC_timeset1=null;
var divObj=null;
var inputName;
function myCalendar() //构建对象
{
var myDate = new Date();
this.year = myDate.getFullYear();
this.month = myDate.getMonth()+1;
this.date = myDate.getDate();
this.format="yyyy-mm-dd";
this.style = myStyle(1);
this.show = createCalendar;
this.input = createInput;
}
function myStyle(num) //设置样式
{
if(!num||isNaN(num)){alert('参数不对,采用默认样式!');num=1;}
var style = new Array();
style[1]=".week{background-color:#DfDfff;font-size:12px;width:140px;}"
+".ds{width:140px;font-size:12px;cursor:hand}"
+".mover{border:1px solid black;background-color:#f4f4f4;}"
+".move1{border:1px solid #5d5d5d;background-color:#f4f4f4;color:#909eff;font-size:12px}"
+".tit{background-color:#909EFF;width:140px;font-size:12px;color:white;cursor:default}"
+".cs{position:absolute;border:1px solid #909eff;width:142px;left:0px;top:0px;z-index:9999;}"
+".shadow{position:absolute;left:0px;top:0px;font-family: Arial Black;font-size:50px;color:#d4d4d4;z-index:1;text-align:center;}";
document.write("<style type='text/css'>");
document.write(style[num]);
document.write("</style>");
}
function createCalendar()
{
var week = new Array('日','一','二','三','四','五','六');
document.write("<div onselectstart='return false' oncontextmenu='return false' >");
}
// --------------End ---------------------
</script>
<script>
var myCalendar=new myCalendar;
myCalendar.year=2009;
myCalendar.show();
myCalendar.input("txt1");
</script>
</HEAD>
<BODY>
<input type="text" name="test" onfocus="showDiv2(this)" readonly=true>
</BODY>
</HTML>