neofibril
06-28-2004, 11:20 AM
Properties such as clientWidth are read-only.
If I recall correctly, once opened, the width and height properties of an html dialog can only be modified from an html application.
They can be set initially in the showModalDialog call, however.
davidklonski
06-28-2004, 01:10 PM
I solved the problem.
Taken from the MSDN library (concerning the usage of resizeTo):
This method does not work on dialog windows. In order to move or size a dialog window, manipulate the dialogHeight, dialogWidth, dialogTop, and dialogLeft properties.
This is my final solution:
function pageResize() {
var currentHeight = 0;
// the frames are set one on top of the other - so I am calculating the total height
for (i=0; i<parent.frames.length; i++) {
currentHeight += parent.frames[i].document.body.clientHeight;
}
var currentWidth = parent.frames[0].document.body.clientWidth;
if (currentWidth < 300) {
parent.dialogWidth = "300px";
}
if (currentHeight < 300) {
parent.dialogHeight = "300px";
}
}