dialogTop
Summary
Gets or sets the Y coordinate position of a dialog window.
Property of dom/WindowModaldom/WindowModal
Syntax
var yCoordinate = window.dialogTop;
window.dialogTop = newXCoordinate;
Return Value
Returns an object of type StringString
The X coordinate position and a unit of measure.
Examples
This example creates a dialog window using the dialogTop property to set the position relative to the top of the screen.
<!doctype html>
<html>
<head>
<script>
function someMessage(e) {
e.target.blur();
window.showModalDialog("message.htm", "",
"dialogWidth:5cm; dialogHeight:10cm; dialogTop:0cm; dialogLeft:0cm")
}
</script>
</head>
<body>
<select onchange="someMessage(event)">
<option>Item 1</option>
<option>Item 2</option>
<option>Item 3</option>
</select>
</body>
</html>
Notes
- This property applies only to windows that are created by using the showModalDialog 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 is
px
- The value can be an integer or floating-point number, followed by an absolute units designator (
cm
,mm
,in
,pt
, orpc
), or a relative units designator (em
,ex
, orpx
). For consistent results, specify thedialogTop
in pixels when you design modal dialog boxes.
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]