文档库

最新最全的文档下载
当前位置:文档库 > DIV遮盖select

DIV遮盖select

<iframe src="javascript:false" style="position:absolute;visibility:inherit; top:45px; left:16px; width:200px; height:70px;z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe>
在我们的div中加了这句话,浮动图片有80%的部分可以显示在select之上了。
经过一番调试,深深感慨,如果浮动广告是矩形那该多好啊~~~~~~~~

网上方法无数,记了两种印象深刻的方法。
DIV遮盖select
1、找个后台,后台硬自己就跟着强了
2、背后阴别人,让别人弱了,就显得自己强了。


1.iframe来当作div的底
<html>
<head>
<script>
function DivSetVisible(state)
{
var DivRef = document.getElementById('PopupDiv');
var IfrRef = document.getElementById('DivShim');
if(state)
{
DivRef.style.display = "block";
IfrRef.style.width = DivRef.offsetWidth;
IfrRef.style.height = DivRef.offsetHeight;
IfrRef.style.top = DivRef.style.top;
IfrRef.style.left = DivRef.style.left;
IfrRef.style.zIndex = DivRef.style.zIndex - 1;
IfrRef.style.display = "block";
}
else
{
DivRef.style.display = "none";
IfrRef.style.display = "none";
}
}
</script>
</head>
<body>
<form>
<select>
<option>A Select Box is Born ....</option>
</select>
</form>
<div id="PopupDiv" style="position:absolute; top:25px; left:50px; padding:4px; display:none; background-color:#000000; color:#ffffff; z-index:100">
.... and a DIV can cover it up<br/>through the help of an IFRAME.
</div>
<iframe id="DivShim" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;">
</iframe>
<br/>
<br/>
<a href="#" onclick="DivSetVisible(true)">Click to show DIV.</a>
<br/>
<br/>
<a href="#" onclick="DivSetVisible(false)">Click to hide DIV.</a>
</body>
</html>

2.隐藏下拉框


<script>
var HideElementTemp = new Array();
//点击菜单时,调用此的函数,菜单对象
function cal_hideElementAll(obj){
cal_HideElement("IMG",obj);
cal_HideElement("SELECT",obj);
cal_HideElement("OBJECT",obj);
cal_HideElement("IFRAME",obj);
}
function cal_HideElement(strElementTagName,obj){
try{
var showDivElement = obj;
var calendarDiv = obj;
var intDivLeft = cal_GetOffsetLeft(showDivElement);
var intDivTop = cal_GetOffsetTop(showDivElement);//+showDivElement.offsetHeight;
//HideElementTemp=new Array()
for(i=0;i<window.document.all.tags(strElementTagName).length; i++){
var objTemp = window.document.all.tags(strElementTagName)[i];
if(!objTemp

DIV遮盖select

(共2页)