【发布时间】:2019-04-19 19:56:05
【问题描述】:
我正在全帧谷歌文档 iframe 之上制作叠加层。我希望文档的顶部被一个 100% 宽度的 div 覆盖,该 div 在悬停时会逐渐消失,从而显示可点击的文档选项。
我已经让淡入淡出过渡工作了,但是不可见的 div 阻止了 iframe 被点击。如果我使用 pointer-events:none,更改 z-index 或 display:none 移动光标时会出现令人讨厌的闪烁效果。
有解决办法吗?
https://github.com/plasticplant/miscresearch/tree/master/miscresearch
#background-site {
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
}
#background-site iframe {
width: 100%;
height: 100%;
border: none;
overflow: scroll;
}
#header {
position: absolute;
width: 100%;
z-index: 30;
font-size: 55px;
font-family: 'Sporting_Grotesque-Bold';
padding: 5px;
text-align: center;
transition: 0.3s;
background: white;
}
#header:hover {
opacity: 0;
}
<div id="header">
miscresearch
</div>
<div id="background-site"><iframe name="backgrnd" id="backgrnd" scrolling="yes" src="https://docs.google.com/document/d/16_jikyP9LfNibSOvM4XPeuB2jhf8YEYES1p8xhTBBDM/edit?usp=sharing"></iframe></div>
【问题讨论】:
-
分享您的代码,以便我们解答!
-
感谢 Zeeshan,我已经添加了代码。