Click to Rate and Give Feedback
Properties
 dialogWidth Property
dialogWidth Property

Sets or gets the width of the modal dialog window.

Syntax

[ sWidth = ] window.dialogWidth

Possible Values

sWidthVariant that specifies or receives the width of the dialog window.

The property is read/write. The property has no default value.

Remarks

The dialogWidth property applies only to windows that are created by using the showModalDialog method and the showModelessDialog method.

The default unit of measure for dialogHeight and dialogWidth in Microsoft Internet Explorer 4.0 is the em; in Internet Explorer 5 it is the pixel. The value can be an integer or floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc), or a relative units designator (em, ex, or px). For consistent results, specify the dialogHeight and dialogWidth in pixels when you design modal dialog boxes.

In Windows Internet Explorer 7, the dialogWidth property returns the width of the content area and no longer includes the width of the frame.

Example

This example creates a dialog window using the dialogWidth property to set the new window's width.

<SCRIPT>
function someMessage()
{
    event.srcElement.blur();
    window.showModalDialog("message.htm", "", 
    "dialogWidth:5cm; dialogHeight:10cm")
}
</SCRIPT> 
</HEAD>
<BODY>
<SELECT onchange="someMessage()">
    <OPTION>Item 1</OPTION>
    <OPTION>Item 2</OPTION>
    <OPTION>Item 3</OPTION>
</SELECT>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this property.

Applies To

window
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker