简体   繁体   English

与浏览器分开打开新窗口弹出窗口

[英]open new window popup separate from browser

I want to open a new window but I want it to be a free floating popup separate from the main browser (not in a new tab) Every example ive found using various javascript/jquery/target="_blank" methods always opens in a new tab. 我想打开一个新窗口,但我希望它是一个独立于主浏览器的自由浮动弹出窗口(不在新标签中)。使用各种javascript / jquery / target =“ _ blank”方法找到的每个示例ive总是在新窗口中打开标签。 I want the window to 'float' separately from the main browser 我希望窗口与主浏览器分开“浮动”

这对我有用,我在我的一个项目中使用了它: https : //jsfiddle.net/9o5f9Ls0/2/

<a onclick="window.open(this.href, 'test', 'left=20,top=20,resizable=0'); return false;" href='https://www.google.com'>Test</a>

See this answer: Make a link open a new window (not tab) 看到这个答案: 使链接打开一个新窗口(不是标签)

Here is a snippet that does what you're describing. 这是您正在描述的代码片段。

<a href="print.html"  onclick="window.open('print.html', 'newwindow', 'width=300, height=250'); return false;"> Print</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM