Reputation: 251
Using Browser : IE 9
I am opening an IE modal dialog by using window.showModalDialog() function.
When dialog is opened, i am providing height and width using dialogHeight and dialogWidth attributes. This works fine.
But the requirement is when the content of the dialog changes, i want to resize the height of the dialog box.
Initially there are certain elements hidden in the dialog and those will be visible on user action because of that vertical scrollbar in the dialog and to avoid that i want to resize the dialog height.
Please suggest.
Thanks, Amit
Upvotes: 1
Views: 3586
Reputation: 769
According to http://msdn.microsoft.com/en-us/library/ie/ms536759(v=vs.85).aspx the modal should automatically resize if the resizable
value in varOptions
(the third argument to your showModalDialog() call) is set to 'yes' (or 1)
Upvotes: 0
Reputation: 161
You can adjust the size in the page which your modal dialog open. For example, look at below code:
t3.html
<!DOCTYPE HTML>
<html>
<head>
<title>test</title>
</head>
<body>
test<br>
test adjust<br>
test adjust<br><br>
<script language=javascript>
function adjustDialog() {
window.dialogHeight = 400+'px';
window.dialogWidth = 400+'px';
}
</script>
<button onclick="adjustDialog();">Adjust me</button>
</body>
</html>
t4.html
<!DOCTYPE HTML>
<html>
<head>
<title>test</title>
</head>
<body>
<script language=javascript>
window.showModalDialog("t3.html","Dialog Box","dialogHeight: 300px; dialogWidth: 300px; dialogTop: 250px; dialogLeft: 300px; edge: Sunken; center: No; help: No; resizable: No; status: No;");
</script>
</body>
</html>
Open t4.html, then popup a modal dialog, click the button in it, can adjust the dialog.
Upvotes: 1