控制DIV自动调整(防Select、Flash、Object遮盖)
来源:互联网 发布:讲故事配音软件 编辑:程序博客网 时间:2024/04/30 05:04
<script language="javascript">
function SelectAllUser(controlID)
...{
var ele = event.srcElement;
if(ele.type=='checkbox')
...{
var checkBoxs = document.getElementsByTagName( "INPUT" );
for(var i=0;i<checkBoxs.length;i++)
...{
if(checkBoxs[i].type=='checkbox' && checkBoxs[i].id.indexOf("QCheckBoxUserList") != -1)
...{
checkBoxs[i].checked = ele.checked;
}
}
}
}
function HideUserList(controlID)
...{
document.getElementById(controlID).style.display = "none";
return false;
}
function ShowUserList(controlID)
...{
//document.getElementById("MailDIV").style.display = "none";
//document.getElementById("UserListDIV").style.display = "none";
var the = event.srcElement;
var div = document.getElementById(controlID);
//alert(document.body.clientHeight + " " + event.y + " " + div.offsetHeight);
if(document.body.clientHeight - event.y - 20 <= div.offsetHeight)
...{
div.style.top = event.y - div.offsetHeight;
}
else
...{
div.style.top = event.y;
}
if(div.offsetHeight == 0)
...{
div.style.top = event.y - 200;
}
div.style.right = document.body.clientWidth - event.x + 25;
div.style.display = "block";
return false;
}
</script>
function SelectAllUser(controlID)
...{
var ele = event.srcElement;
if(ele.type=='checkbox')
...{
var checkBoxs = document.getElementsByTagName( "INPUT" );
for(var i=0;i<checkBoxs.length;i++)
...{
if(checkBoxs[i].type=='checkbox' && checkBoxs[i].id.indexOf("QCheckBoxUserList") != -1)
...{
checkBoxs[i].checked = ele.checked;
}
}
}
}
function HideUserList(controlID)
...{
document.getElementById(controlID).style.display = "none";
return false;
}
function ShowUserList(controlID)
...{
//document.getElementById("MailDIV").style.display = "none";
//document.getElementById("UserListDIV").style.display = "none";
var the = event.srcElement;
var div = document.getElementById(controlID);
//alert(document.body.clientHeight + " " + event.y + " " + div.offsetHeight);
if(document.body.clientHeight - event.y - 20 <= div.offsetHeight)
...{
div.style.top = event.y - div.offsetHeight;
}
else
...{
div.style.top = event.y;
}
if(div.offsetHeight == 0)
...{
div.style.top = event.y - 200;
}
div.style.right = document.body.clientWidth - event.x + 25;
div.style.display = "block";
return false;
}
</script>
只需要在我们的DIV前加IFrame作为底层
<iframe style="position: absolute; z-index: 9; width: expression(this.nextSibling.offsetWidth);
height: expression(this.nextSibling.offsetHeight); top: expression(this.nextSibling.offsetTop);
left: expression(this.nextSibling.offsetLeft);" frameborder="0"></iframe>
<div id="UserListDIV" style="position: absolute; display: none; background-color: White;
z-index: 19; width: 150px;">
<table>
<tr>
<td>
<BenQ:QCheckBox ID="QCheckBoxAll" runat="server" Text="All" AutoPostBack="false"
onclick="javascript:SelectAllUser(this)" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList0" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList1" runat="server" Text="Lionel Li" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList2" runat="server" Text="Laker Yan" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList3" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList4" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList5" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList6" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList7" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList8" runat="server" Text="Jason Xu" /><br>
</td>
</tr>
<tr>
<td style="text-align: center">
<BenQ:QButton ID="QButtonSubmit" runat="server" Text="Save" Type="submit" />
<span class="Span5"></span>
<BenQ:QButton ID="QButtonCancel" runat="server" Text="Cancel" Type="common" OnClientClick="return HideUserList('UserListDIV');" />
</td>
</tr>
</table>
</div>
height: expression(this.nextSibling.offsetHeight); top: expression(this.nextSibling.offsetTop);
left: expression(this.nextSibling.offsetLeft);" frameborder="0"></iframe>
<div id="UserListDIV" style="position: absolute; display: none; background-color: White;
z-index: 19; width: 150px;">
<table>
<tr>
<td>
<BenQ:QCheckBox ID="QCheckBoxAll" runat="server" Text="All" AutoPostBack="false"
onclick="javascript:SelectAllUser(this)" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList0" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList1" runat="server" Text="Lionel Li" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList2" runat="server" Text="Laker Yan" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList3" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList4" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList5" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList6" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList7" runat="server" Text="Jason Xu" /><br>
<BenQ:QCheckBox ID="QCheckBoxUserList8" runat="server" Text="Jason Xu" /><br>
</td>
</tr>
<tr>
<td style="text-align: center">
<BenQ:QButton ID="QButtonSubmit" runat="server" Text="Save" Type="submit" />
<span class="Span5"></span>
<BenQ:QButton ID="QButtonCancel" runat="server" Text="Cancel" Type="common" OnClientClick="return HideUserList('UserListDIV');" />
</td>
</tr>
</table>
</div>
- 控制DIV自动调整(防Select、Flash、Object遮盖)
- 解决DIV层被OBJECT、SELECT控件遮盖问题
- Flash 遮盖DIV 解决方案
- Flash遮盖Div的解决方法
- IE6兼容性问题 select 遮盖div
- Div Select Iframe 的相互遮盖
- div遮盖select的解决方案(简单)
- DIV遮盖select元素(模拟disabled)
- IE6 select穿透问题(div 定位无法遮盖select)!
- select 遮盖
- 关于DIV被Flash或表单遮盖的解决方法
- 关于DIV被Flash或表单遮盖的解决方法
- div层被flash层遮盖问题解决思路
- DIV层被Flash或表单遮盖的解决方法
- Div层被嵌入的Flash层遮盖问题解决思路
- div层被flash层遮盖问题解决方法
- div 浮层遮盖 flash 问题再研究
- 解决div层被select下拉框遮盖的问题
- 新浪首页
- 修改 ubuntu开关机的三个画面
- 一个经典的爱情哲理
- 一个典型的Sql Server 触发器应用
- 终于决定在CSDN安家了
- 控制DIV自动调整(防Select、Flash、Object遮盖)
- C语言学习笔记 (2)
- ILineDecoration Interface
- dotNet中将长文件名转为DOS短文件名
- ALTER TABLE tbl AUTO_INCREMENT = 100;
- js日期计算
- 转:C程序的结构化组织方式
- Oracle PLS-00455
- 只有在AfterDraw 中不需要StartDrawing and FinishDrawing