Search code examples
javascriptinternet-explorer

edge how to enable resizeable about the popup window


I used window.showModalDialog(url,windowName,status)to open a popup window on IE and the popup window can't resizeable.

The showModalDialog doesn't work on Edge ,so I use window.open(url,windowName,status) to replace it on Edge,but the resizeable=no option of window.open(url,windowName,"resizeable=no") does't work on Edge.

How can I enable my popup window resizeable with window.open() on Edge?


Solution

  • The showModalDialog() method is obsolete. For window.open(), IE supports disabling the resizing, but other browsers no longer support it. You can check the Parameter Values of this link.

    As a workaround, you can use jQuery EasyUI Dialog. You can refer to the example below:

    $(function() {
      $('#dd').dialog({
        title: 'My Dialog',
        width: 400,
        height: 200,
        closed: false,
        cache: false,
        href: 'http://www.google.com',
        modal: true,
        resizable: false //It can define whether the dialog box can be resized.
      });
    })
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
    <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
    <div id="dd">Dialog Content.</div>