EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

dialogHeight property

Sets or gets the height of the modal dialog window.

Syntax

JavaScript

p = object.dialogHeight

 

Property values

Type: Variant

the height of the dialog window.

Remarks

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

When a script calls the showModalDialog method, it suspends execution until the modal dialog box is closed. As a result, the script cannot use the dialogHeight property to change the appearance of the modal dialog box. To control the appearance of the modal dialog box, use script in the file loaded by the sURL parameter or use the value of the sFeatures parameter to specify the desired settings.

Although a user can manually adjust the height of a dialog box to a smaller value—provided the dialog box is resizable—the minimum dialogHeight you can set using script is 100 pixels.

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

The default unit of measure for dialogHeight and dialogWidth in Microsoft Internet Explorer 4.0 is the em; in Microsoft 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.

Examples

This example creates a dialog window using the dialogHeight property to set the new window's height.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/dialogHeight.htm


<!DOCTYPE html>
<html>
<head>
  <title>dialogHeight</title>
</head>

<body>
  <p>
    The select box's <b>onchange</b> event will fire off a script creating a modal dialog box, 
    with a height of 10cm, that simply loads this page into it.
  </p>
  <select id="selectElement">
    <option>Item 1</option>
    <option>Item 2</option>
    <option>Item 3</option>
  </select>
  <script>
    document.getElementById('selectElement').addEventListener('change', someMessage, false);

    function someMessage(event) {
      event.srcElement.blur();
      window.showModalDialog("dialogHeight.htm", "", "dialogWidth:5cm; dialogHeight:10cm")
    }
  </script>
</body>
</html>

See also

window

 

 

표시:
© 2014 Microsoft