当前位置:首页>宠物>正文

如何让iframe里弹出的层显示在整个网页上

2024-07-27 15:23:15 互联网 未知 宠物

如何让iframe里弹出的层显示在整个网页上?

如何让iframe里弹出的层显示在整个网页上

编写HTML代码时候用Iframe中弹出层覆盖整个页面,代码如下:

http://www.w3.org/TR/html4/loose.dtd">

var cover =mydiv= nullwindow.onload = function() { cover=document.getElementById(coverdiv) cover.style.width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth)+ "px" cover.style.height = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + "px" cover.style.display = "none" mydiv = document.getElementById(mydiv) with (mydiv){ style.width = document.documentElement.scrollHeight/2+"px" style.height = document.documentElement.scrollHeight/2+"px" style.left = (document.documentElement.scrollWidth - mydiv.offsetWidth)/2+"px" style.top = (document.documentElement.scrollHeight - mydiv.offsetHeight)/2+"px" style.display = "none" }}function popit(){ mydiv.style.display=cover.style.display = }
我的层

Button按钮点击调用上面的事件: