日期:2014-05-17  浏览次数:21277 次

在线等,急,ASP单击文本框出现日期控件?做一个日期的
在线等,急,ASP单击文本框出现日期控件?做一个日期的

------解决方案--------------------
/*firefox window.event*/
function __firefox(){
HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style);
window.constructor.prototype.__defineGetter__("event", __window_event);
Event.prototype.__defineGetter__("srcElement", __event_srcElement);
}
function __element_style(){
return this.style;
}
function __window_event(){
return __window_event_constructor();
}
function __event_srcElement(){
return this.target;
}
function __window_event_constructor(){
if(document.all){
return window.event;
}
var _caller = __window_event_constructor.caller;
while(_caller!=null){
var _argument = _caller.arguments[0];
if(_argument){
var _temp = _argument.constructor;
if(_temp.toString().indexOf("Event")!=-1){
return _argument;
}
}
_caller = _caller.caller;
}
return null;
}
if(window.addEventListener){
__firefox();
}
/*end firefox.event
----------------------------------------*/
//日历显示的对象
document.writeln("<style>#LTDiv{overflow:hidden;margin:0px;position:absolute;width:144px;display:none;border:1px solid #78B9D8;padding:1px;background-color:#fff;}\r\
#LTDiv ul,#LTDiv li{border:0px;margin:0px;padding:0px;font-size:12px;font-family:宋体;list-style:none}\r\
.LTYear li{float:left;line-height:22px;width:14px;text-align:center;cursor:pointer;}\r\
.LTYear{background-color:#FCFDFE;border-bottom:1px solid #fff;color:#00c;clear:both;height:22px;}\r\
.LTWeek li{float:left;width:20px;text-align:center;line-height:20px;color:#fff}\r\
.LTWeek{background-color:#78B9D8;height:20px;clear:both}\r\
.LTDay{border:0px;margin:0px;padding:0px;clear:both}\r\
.LTDay ul{clear:both}\r\
.LTDay li{float:left;width:20px;text-align:center;height:20px;line-height:20px;color:#04d}\r\
.LTDay .ifo2{color:#AAA}\r\
.LTDay .ifo1{cursor:pointer}\r\
.LTDay .ifo3{cursor:pointer;font-weight:bold;text-decoration:underline}\r\
.LTDay .ifo4{cursor:pointer;background-color:#DDEDF4;}\r\
</style>")
document.writeln("<div id='LTDiv'></div>")
//日历初始化
function WebCalendar(){
this.iYear = new Date().getFullYear();//年
this.iMonth = new Date().getMonth()+ 1;//月
this.iToday = new Date().getFullYear()+"-"+appendZero(new Date().getMonth()+1)+"-"+appendZero(new Date().getDate());//今天
this.iObj = null;
this.uObj = null;
}
var iCalendar = new WebCalendar()
//日历显示的对象内容
function DivCalendar(){
var iYear = iCalendar.iYear; 
var iMonth = iCalendar.iMonth-1; 
var iWeek = new Date(iYear, iMonth, 1).getDay();//星期
var iEndDay = new Date(iYear, iMonth +1, 0).getDate();//最后一天

var CalendarText="<div class='LTYear'><ul><li onclick='SetYear(-1)' title='向前翻 1 年'>&lt;&lt;</li><li onclick='SetMonth(-1)') title='向前翻 1 月'>&lt;</li><li style='width:50px;text-align:center'>"+iYear+"年</li><li style='width:30px;text-align:center'>"+appendZero(iMonth+1)+"月</li><li onclick='SetMonth(1)' title='向后翻 1 月'>&gt;</li><li onclick='SetYear(1)' title='向后翻 1 年'>&gt;&gt;</li></ul></div>";
CalendarText+="<div class='LTWeek'><ul><li style='color:#FFFF15'>日</li><li>一</li><li>二</li><li>三</li><li>四</li><li>五</li><li style='color:#FFFF15'>六</li></ul></di