Opening Popup Window is not working in firefox and google chrome

倾然丶 夕夏残阳落幕 提交于 2020-01-05 13:28:24

问题


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');     
     }

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.

Thanks in Advance


回答1:


The syntax of the args is different. For example:

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


来源:https://stackoverflow.com/questions/2144921/opening-popup-window-is-not-working-in-firefox-and-google-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!