弹出窗口打开全屏在Firefox中,虽然尺寸给出 [英] pop up window opens fullscreen in firefox though sizes are given
本文介绍了弹出窗口打开全屏在Firefox中,虽然尺寸给出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码:
< a href =agb.htmltarget =_ blankonclick =return popup(this.href);> linkname< / a>
以下功能:
< script type =text / javascript>
function popup(url){
fenster = window.open(url,Popup,width = 640,height = 700,resizable = yes,scrollbars = yes);
fenster.focus();
返回false;
}
< / script>
解决方案
知道在Firefox的作品(实际上它是我测试它的唯一的东西)。
我不太了解js,所以我确定我是从网上找到的 - 希望它遵循正确的做法,什么不是。
// js:
//弹出窗口代码
函数newPopup(url){
popupWindow = window.open(
url,'popUpWindow','height = 390,width = 350,left = 10,top = 10,resizable = yes,scrollbars = yes,toolbar = no,menubar = no,location = no,directories = no,status = yes')
}
< / script>
// link:edit:onclick event should be used instead,but I'm leaving my original code。
< a href =Javascript :newPopup('/ url /');>链接文字< / a>
I'm opening a Popup, it opens in internet explorer and mozilla firefox. But firefox ignores the given sizes, so a fullscreen popup is created.
Following code:
<a href="agb.html" target="_blank" onclick="return popup(this.href);">linkname</a>
Following function:
<script type="text/javascript">
function popup (url) {
fenster = window.open(url, "Popup", "width=640,height=700,resizable=yes,scrollbars=yes");
fenster.focus();
return false;
}
</script>
解决方案
This is what I have on a dev site which I know at works in Firefox (actually it's the only thing I have tested it on. I don't know too much about js, so I'm sure I got this from the web somewhere- so hopefully it follows correct practices and what not.
// js:
<script type="text/javascript">
// Popup window code
function newPopup(url) {
popupWindow = window.open(
url,'popUpWindow','height=390,width=350,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes')
}
</script>
// link: edit: an onclick event should be used instead, but I'm leaving my original code.
<a href="Javascript:newPopup('/url/');">Link text</a>
这篇关于弹出窗口打开全屏在Firefox中,虽然尺寸给出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文