gpt4 book ai didi

javascript - window.open 没有应用给定的高度参数

转载 作者:太空宇宙 更新时间:2023-11-04 15:35:13 24 4
gpt4 key购买 nike

我在执行 url 的 window.open 的链接上有一个 onclick 事件,我还为其提供了自定义宽度和高度,但不接受它并且弹出窗口以不同的宽度和高度显示..有人可以指导我那一定是错的吗

我的window.open语法如下

onclick='var myW=window.open ("http://www.google.co.jp/","mywindow","location=1,toolbar=1,menubar=1,resizable=1,width=846,height=786");

还有如何改变弹窗在屏幕中的显示位置?

NOTE: AFTER ALL THE REPLIES Being Positive with my code.. I tried it and found after thinking about it that whatever size I was giving in parameter the browser taking it more than that... May be thats due to resolution....

最佳答案

您的代码运行良好:

<html>
<head>
</head>
<body>
<input type="button" value="cl" onclick='var myW=window.open

("http://www.google.co.jp/","mywindow","location=1,toolbar=1,menubar=1,resizable=1,width=200,height=200");'>
</body>
</html>

更多信息请查看:- http://www.w3schools.com/jsref/met_win_open.asp
在打开后立即窗口定位弹出窗口使用:-

window.moveTo(50,50);//your window object:-

moveTo 的参数是窗口左上角的 left 位置和 top 位置。

关于javascript - window.open 没有应用给定的高度参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9612745/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com