简体   繁体   English

我想在最大化模式下单击按钮在浏览器中打开新窗口

[英]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:您将打开的窗口的大小(我认为您的意思是弹出窗口)可以通过属性widthheight 设置,如下所示:

<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_widthyour_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.

相关问题 单击表单按钮打开新的浏览器窗口 - Open new browser window on click of a form button 我想单击打开一个弹出窗口并在新窗口中插入一个按钮以允许用户关闭 - I want to open a popup window on a click and insert a button in the new window to allow closing by user 我想使用CSS选择器单击一个元素,然后在新的浏览器窗口中将其打开,然后使用Jquery或JS将其发送到现有浏览器窗口的后面 - I want to click an element using css selectors and open it in a new browser window then send it behind the existing browser window using Jquery or JS 如何禁用最大化,最小化和关闭按钮以打开新窗口 - How to disable maximize,mimimize and close button for a new window open 单击一个按钮时如何打开新的 window? - How to open a new window when i click one button? 在新窗口中打开div-单击按钮 - Open a div in new window - on-click of button 单击 electron 中的按钮打开一个新的 window - Open a new window on click of button in electron Chrome扩展程序可在Chrome浏览器弹出窗口中单击按钮后打开新的弹出网址 - Chrome extension to open a new popup url on button click in chrome browser popup window 每次单击 angular 按钮时,如何关闭已打开的窗口,然后打开一个新窗口? - How can i close an already opened window and then open a new window every time i click a button in angular? 我想在没有地址栏的情况下打开新窗口 - I want to open new window with no address bar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM