EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

dialogTop property

Sets or gets the top coordinate of the modal dialog window.

Syntax

JavaScript

p = object.dialogTop

 

Property values

Type: Variant

the top coordinate of the dialog window.

Remarks

The dialogTop 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 dialogTop 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.

The default unit of measure for dialogTop 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 dialogTop in pixels when you design modal dialog boxes.

Examples

This example creates a dialog window using the dialogTop property to set the position relative to the top of the screen. Do not break the script code into two lines as in the fourth line of the example. This was done for readability only.

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


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

<body>
  <p>
    The select box's <strong>onchange</strong> event will fire off 
    a script creating a modal dialog box located in the upper left 
    corner of the screen (dialogTop: 0cm; dialogLeft: 0cm).
  </p>
  <select onchange="someMessage(this)">
    <option>Item 1</option>
    <option>Item 2</option>
    <option>Item 3</option>
  </select>
  <script>
    function someMessage(target) {
      target.blur();
      window.showModalDialog("dialogWidth.htm", "", "dialogWidth:5cm; dialogHeight:10cm; dialogTop:0cm; dialogLeft:0cm")
    }
  </script>
</body>
</html>

See also

window

 

 

Anzeigen:
© 2014 Microsoft