我正在尝试使用 iFrame 显示整个页面,但 5 秒后,我希望在 iFrame 上弹出一个灯箱。我遇到的问题是 iFrame 位于 LightBox 弹出窗口的顶部,我不知道如何将其反过来。
我读到如果 iFrame 源有一个 flash 播放器,那可能是原因;但页面上的任何地方都没有 Flash。一个多小时以来,我一直在修补东西,但无法弄清楚我没有做什么。
这是带有 iFrame 的页面: iFrame
这是没有 iFrame 的页面:No iFrame
我知道计时器和 LightBox 弹出窗口正在工作,它们只是隐藏在 iFrame 后面。有什么问题吗?
<body>
<script type="text/javascript">
$(document).ready(function() {
var count = 5;
var counter = setInterval(timer, 1000);
function timer() {
count = count - 1;
if (count <= 0) {
clearInterval(counter);
$("#showFB").trigger('click');
return;
}
}
});
</script>
<a id="showFB" href="img/globe.png" data-lightbox="image-1" title="" style="display:none">i</a>
<iframe title="ats" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:visible; z-index:999999;" src="http://www.automatedtrafficsuite.com/login"></iframe>
</body>
最佳答案
你有 z-index 问题
为灯箱的z-index赋予更大的值(value)
在 lightbox.css 第 8 行
z-index: 999999;
在 lightbox.css 第 20 行
z-index: 1000000;
关于javascript - LightBox2 隐藏在 HTML iFrame 后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18133076/