我希望有可能点击 iframe 内的链接,并能够在按钮附近执行任何鼠标操作,但仍在 iframe 内。
当我将 pointer-events: none;
添加到整个 iframe 并尝试通过将 pointer-events: all;
设置为按钮来忽略它时(我可以编辑iframe 源)它看起来仍然不接受此规则。
有没有人知道这是否可能? iframe 的大小必须更大,因为单击按钮后内容会发生变化,并且会出现按钮上方的元素。
最佳答案
试试这个:
iframe {
position: fixed;
bottom: 0;
right: 0;
border: 1px solid #000;
pointer-events: all;
height: 400px;
}
iframe > * {
pointer-events: none;
}
How can you make an iframe have pointer-events: none; but not on a div inside that?
关于html - 忽略 iframe 中的指针事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50390895/