【发布时间】:2017-05-11 10:55:05
【问题描述】:
我希望在新窗口中打开外部链接,这对用户来说是显而易见的,因此希望弹出窗口的大小与父窗口的相对大小。最初我只是使用了目标属性,但后来开始使用这样的东西:
<a href="http://example.org"
onclick="window.open(this.href,'window','width=810,height=480,location=0, resizable, scrollbars, toolbar=0, menubar=0') ;return false;">example.org</a>
但我只能让它与像素值一起使用,并且我想让弹出窗口的宽度和高度相对于设备的屏幕尺寸 (%)。 看起来很简单,但我在网上找不到任何简单解释如何做的东西。 任何人都可以帮忙吗? 提前致谢。
编辑 这是一个样板页面:
<?php
require("docHead.php");
?> this includes everything needed at the head of a document
<title>...</title> varies with the page
</head>
<body>
<?php
require("bannerMenu.php");
?> navigation etc
<div id="..">
<div id="..">
<h1>...</h1>
<h2>...</h2>
Ipsum lorem etc <a href=.....>
<?php
require("footer.php");
?>
</div>
</div>
</body>
</html>
【问题讨论】:
-
请分享您到目前为止所尝试的内容
-
嗨,克里斯,我尝试编辑表达式以使用 % 但这不起作用,我在网上搜索了相关信息,但没有发现任何有用的信息。有什么建议么?也许我认为简单的事情实际上很复杂,我需要从其他地方开始......不知道还能说什么。 ps也许你阅读帖子时我附加的代码没有显示 - 但我至少可以正常工作(虽然没有更简单的方法吗?)
-
例如,我读过stackoverflow.com/questions/4316019/…,但不理解它,并认为它可能在谈论不同的情况。
标签: javascript html popup