在悬停
如何有效地渲染iframe durig悬停如图所示在这里
<a class="iframe-link" href="https://saheed.codes/uses">Home Page<iframe src="https://saheed.codes/" loading="lazy" style={{width: "100%", height: "600px", border: "0px none"}}></iframe></a>
.iframe-link iframe {
display: none;
}
.iframe-link:hover iframe {
display: block;
}
我正在与React合作,并进行风风,并会欣赏该方向的答案。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果要避免使用包装器,则可以直接在IFRAME上使用
obacity
。您已经有一个预留空间可以使用,并且不必使用包装纸。这取决于您的用例,您的解决方案是有效的选择。If you want to avoid using a wrapper for it, you could use
opacity
directly on the iframe. You would already have a reserved space for it and you wouldn't have to use a wrapper. It depends a bit on your use case, your solution is a valid alternative.最终这样做
Ended Up doing it this way