在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屋!
查看全文