我想在单击我的按钮 div 时使用 window.open 方法打开一个特定大小的窗口。我引用了其他一些在线资源,并了解了这一点。
<div class="button" onclick="window.open('http://google.com', '_blank', 'width=600', 'height=600');return false;"></div>
我不确定自己做错了什么,宽度在 Firefox 中有效,但高度却无效。这些都不适用于 Chrome。
最佳答案
所有窗口选项都放在一个字符串中:
<div class="button" onclick="window.open('http://google.com', '_blank', 'width=600, height=600');return false;"></div>
关于javascript - 使用 JavaScript 将窗口打开到特定大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28594596/