[英]I want to open the new window in browser on the click of button in maximize mode
I have tried window.open()
and resizeTo(screen.width,screen.height)
but it is not opening in maximize view.我试过
window.open()
和resizeTo(screen.width,screen.height)
但它没有在最大化视图中打开。
Please help with the relevant code.请帮忙提供相关代码。
you can resizeTo()
only the window, that was created by window.open()
.您只能
resizeTo()
由window.open()
创建的窗口。 First of all you should create and write to any var your window instance.首先,您应该创建并写入您的窗口实例的任何变量。 And after that you can use its methods.
之后你可以使用它的方法。 Here is an example:
下面是一个例子:
myExternalWindow = window.open("http://myurl.domain", "myWindowName", "resizable");
myExternalWindow.resizeTo(screen.availWidth,screen.availHeight);
Good luck!祝你好运!
Try window.open with screen.availHeight / screen.availWidth.尝试使用 screen.availHeight / screen.availWidth 的 window.open。
eg例如
window.open(src, "newWin", "width="+screen.availWidth+",height="+screen.availHeight)
The size of the window (I think you mean a popup window) you'll open can be set through the attributes width and height like below:您将打开的窗口的大小(我认为您的意思是弹出窗口)可以通过属性width和height 设置,如下所示:
<a href="your-http-address.php" onclick="window.open(this.href,'targetWindow',
'toolbar=no,
location=no,
status=no,
menubar=no,
scrollbars=yes,
resizable=yes,
width=your_width,
height=your_height');
return false;">Open PopUp Window</a>
Where the placeholder your_width and your_height specify the popup dimensions.其中占位符your_width和your_height指定弹出尺寸。 To make the popup cover the entire screen dimensions, just use screen.availWidth and screen.availHeight.
要使弹出窗口覆盖整个屏幕尺寸,只需使用 screen.availWidth 和 screen.availHeight。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.