当前位置: 代码迷 >> ASP.NET >> 怎么将iframe作为一个弹出层
  详细解决方案

怎么将iframe作为一个弹出层

热度:5517   发布时间:2013-02-25 00:00:00.0
如何将iframe作为一个弹出层?
父页面中有一个iframe,单击父页面中的按钮可以显示出iframe,但是怎么让iframe作为一个层弹出来,并且覆盖父页面,是用户只对操作iframe,不能对父页面进行操作

------解决方案--------------------------------------------------------
JScript code
function openWindow2(zindex,width,height,alpha){    var iWidth = document.documentElement.scrollWidth;     var bgDiv = document.createElement("div");    bgDiv.id="bg";    bgDiv.style.cssText = "top:0;width:"+iWidth+"px;height:"+document.documentElement.scrollHeight+"px;filter:Alpha(Opacity="+alpha+");opacity:0.3;z-index:"+zindex+";";    document.body.appendChild(bgDiv);     var msgDiv=document.createElement("div");    msgDiv.id="msg";    msgDiv.style.cssText ="position: absolute;z-index:"+(zindex+1)+";width:"+width+"px; height:"+(height=="auto"?height:(height+"px"))+";";    document.body.appendChild(msgDiv);    }
  相关解决方案