我一直在努力使它现在起作用一段时间。这可能是琐碎的CSS。
图像没有覆盖页面顶部的IFrame,而是直接拍摄到底部。
码:
.overlay{
width: 100%;
height:100%;
position:relative;
}
.overlay1{
z-index: 1;
position:absolute;
left: 55%;
margin-right: -50%;
transform: translate(-50%, -50%);
width: 40px;
height: 20px;
background-color: rgba(0,0,0,0.5);
}
.frame {
width: 100%;
height: 100%;
}
<div class="overlay">
<iframe class="frame" allowtransparency="true" src="http://blah.com"></iframe>
<div class="overlay1">
<img src="http://www.ore-processing.com/d/images/livechat.png" class="my_popup_open"></img>
</div>
</div>
基本上,我试图在IFrame上方放置一个按钮,然后在其上覆盖聊天窗口的弹出窗口(JQuery)。
先感谢您。
最佳答案
将叠加层div放在html中的iframe下,而不要放在其周围,并以绝对位置和边距顶部减去某个数字的方式将其拉出。
<iframe></iframe>
<div></div>