我需要在新的弹出窗口中显示一个 iframe,这样 iFrame 应该看起来像子页面的正常内容而不是 iframe。 这是我正在使用的代码。
<html>
.
.
<a class="link" href="javascript:popup();">show popup</a>
.
.
</html>
通过单击显示弹出窗口,我调用了正在打开窗口的 javascript 函数。 代码是:
window.open('../jsp/popupPage.jsp','targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=1050,height=2000
而popupPage.jsp包含以下内容:
<html>
<head>
<title>Cancellation Policy</title>
</head>
<body>
<span>Blah Blah</span>
<br /><br />
<iframe src="http://google.co.in" ></iframe>
</body>
</html>
现在的问题是 iframe 显示时带有边框,滚动时看起来不太好。 我想要类似 iframe 内容的内容应该看起来像普通页面的内容以及 Blah Blah (iframe 内容)
我使用了 HTML5 的无缝属性,但它只适用于 chrome 浏览器。 还有一点要注意,我不能使用 overflow="no",因为我不确定来自第三个站点的 iframe 页面的宽度和高度。
最佳答案
您可以在声明 iframe 时添加以下标记。
frameBorder="0"
你的标签看起来像这样
<iframe frameBorder="0" src="http://google.co.in" ></iframe>
关于javascript - 没有边框的 iframe 并在弹出窗口中滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19636970/