在 HTML 中为 target=“_blank"打开新窗口; [英] Opening new window in HTML for target="_blank"
本文介绍了在 HTML 中为 target=“_blank"打开新窗口;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<a href="facebook.com/sharer" target="_blank" >Share this</a>
当用户单击它时,如何在新窗口中使其具有特定的宽度和高度?在firefox中,当前代码只打开一个新标签页(不是新窗口)
How do I make this a certain width and height, in a new window, when the user clicks on it? In firefox, the current code only opens up a new tab (not a new window)
推荐答案
要在带有尺寸和所有内容的新窗口中打开,您需要调用 JavaScript 函数,因为 target="_blank" 不会让您调整尺寸.一个例子是:
To open in a new windows with dimensions and everything, you will need to call a JavaScript function, as target="_blank" won't let you adjust sizes. An example would be:
<a href="http://www.facebook.com/sharer" onclick="window.open(this.href, 'mywin',
'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" >Share this</a>
希望对你有帮助.
这篇关于在 HTML 中为 target=“_blank"打开新窗口;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文