August 17, 2001 - The Dialog Box's Size | WebReference

August 17, 2001 - The Dialog Box's Size

Yehuda Shiran August 17, 2001
The Dialog Box's Size
Tips: August 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

The dialogHeight parameter sets the height of the dialog window. Try opening a window without specifying its height. A default size window opens. Now, open a window 200 pixels high. Here is the function call:

window.showModalDialog('010817.html','','dialogHeight:200px');
Since the default unit of measure for physical dimensions is not consistent between different versions of Internet Explorer, it is safer to always specify the units. You can use absolute units (cm, mm, in, pt, pc, or px) or relative units (em or ex). You cannot specify a very small window height. The minimum is 100px.

Let's play with the window's width now. To open a window 800 pixels wide and 200 pixels high (try it), you would go:

window.showModalDialog('010817.html','','dialogHeight:200px;dialogWidth:800px');
For more on modal and modeless dialog boxes, go to Column 90, Modal and Modeless Dialog Boxes.