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?
Advertisement
Answer
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:
JavaScript
x
12
12
1
$(function() {
2
$('#dd').dialog({
3
title: 'My Dialog',
4
width: 400,
5
height: 200,
6
closed: false,
7
cache: false,
8
href: 'http://www.google.com',
9
modal: true,
10
resizable: false //It can define whether the dialog box can be resized.
11
});
12
})
JavaScript
1
4
1
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
2
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
3
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
4
<div id="dd">Dialog Content.</div>