打开弹出窗口不能在Firefox和谷歌Chrome工作 [英] Opening Popup Window is not working in firefox and google chrome

查看:144
本文介绍了打开弹出窗口不能在Firefox和谷歌Chrome工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开一个popupwindow(只有关闭按钮),当用户点击一个按钮和父窗口应该被禁止,直到弹出窗口关闭。对于我使用下面的code

I want to open a popupwindow (with close button only) when the user clicks a button and the parent window should be disabled until the popup window closed. For that I'm using the following code

function popup_window(url) {

     popupwin = window.showModalDialog(url,null,'height=20,width=150,status=no,resizable=no,scrollbars=no,toolbar=no,location=no,menubar=no');     
     }

总之,这code在IE浏览器可以正常使用。但是,我甲肝两个问题。
在Firefox中,它不与我在剧本中提到的开口尺寸。它是开放的全尺寸。而在谷歌Chrome,是没有得到关闭父窗口。

Anyhow, this code is working perfectly in IE. But, I hav two problems. In firefox, it is not opening with the size I've mentioned in the script. It is opening in full size. And In Google Chrome, parent window is not getting disabled.

由于提前

推荐答案

的参数语法ARGS 是不同的。例如:

The syntax of the args is different. For example:

window.showModalDialog(url, null, 
"dialogwidth: 150; dialogheight: 20; resizable: no")

这篇关于打开弹出窗口不能在Firefox和谷歌Chrome工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆