时间控件11

function getDateString(oInputSrc,oInstance,content)
{ //content指定控件所在的父元素中 第一个带滚动条的父元素
//alert(oInputSrc); alert(oInstance);
//alert(22); return;
if(oInputSrc&&oInstance)
{
var CalendarDiv=$(oInstance.sDIVID);
oInstance.oTaget=oInputSrc;

/* mfb +stz*/
// alert(CalendargetPos(oInputSrc,"Left")+oInstance.Width); // alert(screen.width)
CalendarDiv.style.display="";
CalendarDiv.style.pixelLeft=-oInstance.Width-100;
CalendarDiv.style.pixelTop=-CalendarDiv.offsetHeight-100;
// alert(CalendarDiv);
if(checkWebBrouser()!="IE"){
CalendarDiv.style.left=-oInstance.Width-100;
CalendarDiv.style.top=-CalendarDiv.offsetHeight-100;
}
//alert(CalendarDiv.scrollHeight); //alert(CalendarDiv.clientHeight); alert(CalendarDiv.offsetHeight);
var posleft=CalendargetPos(oInputSrc,"Left"), postop=CalendargetPos(oInputSrc,"Top") + oInputSrc.offsetHeight;
// CalendarDiv.style.display=(CalendarDiv.style.display=="none")?"":"none";
//if(!content){
//}else{
var content=$(content);
//}
if(!content) content=document.body;
if(CalendarDiv.style.pixelLeft<0){ //显示或隐藏【其实是移动到负的一段的距离】
if(content!=document.body){ //alert(1);
if(posleft+oInstance.Width <content.scrollWidth){
CalendarDiv.style.left=posleft-content.scrollLeft+"px";
CalendarDiv.style.top=postop-content.scrollTop+"px"; //pixelTop
}else{
CalendarDiv.style.left=content.offsetWidth+parseInt(content.currentStyle.paddingLeft)+parseInt(content.currentStyle.paddingRight)-oInstance.Width+"px"; //中间多那些是因为content的scrollWidth没算入padding的空间
CalendarDiv.style.top=postop-content.scrollTop+"px";
}
}else{ // if(content!=document.body)
if(posleft+oInstance.Width <content.scrollWidth){
if(postop+CalendarDiv.clientHeight<content.scrollHeight){
CalendarDiv.style.left=posleft+"px";
CalendarDiv.style.top=postop+"px";
}else{
CalendarDiv.style.left=posleft+"px";
CalendarDiv.style.top=CalendargetPos(oInputSrc,"Top")-CalendarDiv.offsetHeight+"px";
}
}else{
if(postop+CalendarDiv.clientHeight<content.scrollHeight){
CalendarDiv.style.left=content.scrollWidth-oInstance.Width+"px";
CalendarDiv.style.top=postop+"px";
}else{
CalendarDiv.style.left=content.scrollWidth-oInstance.Width+"px";
CalendarDiv.style.top=CalendargetPos(oInputSrc,"Top")-CalendarDiv.offsetHeight+"px";
}
}
}
}else{
CalendarDiv.style.left=-oInstance.Width-100+"px";
CalendarDiv.style.top=-CalendarDiv.offsetHeight-100+"px";
}
if(getIEVersion()=="IE6"){ //+stz 解决ie6 层被select挡住的bug
//alert(1);
var maskDiv=document.getElementById("bottom_"+ oInstance.sDIVID);
if(!maskDiv){
var framemask = "<iframe src='' frameborder='0' id='bottom_"+ oInstance.sDIVID +"' style='visibility:visible;position:absolute;width:0px;height:0px;left:0px;top:0px;background-color:#ffffff; z-index:999'></iframe>" // allowtransparency='true'
document.body.insertAdjacentHTML("beforeEnd", framemask);
maskDiv=document.getElementById("bottom_"+ oInstance.sDIVID);
maskDiv.style.width = CalendarDiv.offsetWidth;
maskDiv.style.height = CalendarDiv.offsetHeight;
maskDiv.style.left = CalendarDiv.style.pixelLeft;
maskDiv.style.top = CalendarDiv.style.pixelTop;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值