我正在尝试创建一个将出现在页面中间的弹出框。外框由我们使用的 CMS 定义,并且附加了溢出:隐藏和宽度:250px 样式。我们想要“摆脱外盒”的内盒在我们的控制之下,我们几乎可以做任何我们想做的事情。
不幸的是,我们在 IE 中尝试的一切都不会让弹出窗口从父框的溢出中“逃脱”:隐藏。在我们的例子中,将弹出窗口移到父 div 之外是不可能的。
注意 - 我们测试过的所有其他浏览器都可以按照我们的意愿工作。
这是一个简单的例子。
<html>
<body>
<div style="width:250px; overflow:hidden; background-color:#dddddd;">
<p>
Here is some text that appears within the primary outer box.
</p>
<div id='popup2' style="position:absolute; z-index:500; top:0px; left:0px; width:400px; height:200px; background-color:pink;">
<a href="#" onclick="document.getElementById('popup2').style.display = 'none'; return false;">Close</a><br/>
This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup.
This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup.
This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup. This is the popoup.
</div>
</div>
</body>
</html>