aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/showmodaldialog/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/window/showmodaldialog/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/window/showmodaldialog/index.html')
-rw-r--r--files/zh-cn/web/api/window/showmodaldialog/index.html80
1 files changed, 80 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/window/showmodaldialog/index.html b/files/zh-cn/web/api/window/showmodaldialog/index.html
new file mode 100644
index 0000000000..81c0bb505f
--- /dev/null
+++ b/files/zh-cn/web/api/window/showmodaldialog/index.html
@@ -0,0 +1,80 @@
+---
+title: Window.showModalDialog()
+slug: Web/API/Window/showModalDialog
+translation_of: Web/API/Window/showModalDialog
+---
+<div>{{ Fx_minversion_header(3) }} {{ deprecated_header() }}{{APIRef}}</div>
+
+<p> <strong><code>Window.showModalDialog()</code></strong> 用于创建和展示一个指向特定网页的模态对话框。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><var>returnVal</var> = window.showModalDialog(<var>uri</var>[, <var>arguments</var>][, <var>options</var>]);
+</pre>
+
+<p>其中</p>
+
+<ul>
+ <li><code>returnVal</code> 集合类型(Set)返回值。由<code>uri</code>指定的页面返回。</li>
+ <li><code>uri</code> 要在模态对话框中打开的页面URI。</li>
+ <li><code>arguments</code> 可选变量。可以通过该参数将需要的值传入对话框; 参数可以通过 <code><a href="/en-US/docs/DOM/window">window</a></code> 对象的<code><a href="/en-US/docs/DOM/window.dialogArguments">window.dialogArguments</a></code> 属性获取。</li>
+ <li><code>options</code> 可选字符串参数。用于设置对话框打开的样式,使用一个或多个逗号分隔。</li>
+</ul>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th>Syntax</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>center: {on | off | yes | no | 1 | 0 }</code></td>
+ <td>If this argument's value is <code>on</code>, <code>yes</code>, or 1, the dialog window is centered on the desktop; otherwise it's hidden. The default value is <code>yes</code>.</td>
+ </tr>
+ <tr>
+ <td><code>dialogheight: <em>height</em></code></td>
+ <td>Specifies the height of the dialog box; by default, the size is specified in pixels.</td>
+ </tr>
+ <tr>
+ <td><code>dialogleft: <em>left</em></code></td>
+ <td>Specifies the horizontal position of the dialog box in relation to the upper-left corner of the desktop.</td>
+ </tr>
+ <tr>
+ <td><code>dialogwidth: <em>width</em></code></td>
+ <td>Specifies the width of the dialog box; by default, the size is specified in pixels.</td>
+ </tr>
+ <tr>
+ <td><code>dialogtop: <em>top</em></code></td>
+ <td>Specifies the vertical position of the dialog box in relation to the upper-left corner of the desktop.</td>
+ </tr>
+ <tr>
+ <td><code>resizable: {on | off | yes | no | 1 | 0 }</code></td>
+ <td>If this argument's value is <code>on</code>, <code>yes</code>, or 1, the dialog window can be resized by the user; otherwise its size is fixed. The default value is <code>no</code>.</td>
+ </tr>
+ <tr>
+ <td><code>scroll: {on | off | yes | no | 1 | 0 }</code></td>
+ <td>If this argument's value is <code>on</code>, <code>yes</code>, or 1, the dialog window has scroll bars; otherwise its size is fixed. The default value is <code>no</code>.</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>{{Note("Firefox does not implement the <code>dialogHide</code>, <code>edge</code>, <code>status</code>, or <code>unadorned</code> arguments.")}}</p>
+
+<h2 id="Compatibility" name="Compatibility">Compatibility</h2>
+
+<p>Introduced by Microsoft Internet Explorer 4. Support added to Firefox in Firefox 3 (deprectated in Fx 28), and to Safari in Safari 5.1.</p>
+
+<h2 id="Examples" name="Examples">Examples</h2>
+
+<p><a href="/samples/domref/showModalDialog.html">Try out <code>showModalDialog()</code></a>.</p>
+
+<h2 id="Notes" name="Notes">Notes</h2>
+
+<p><code>showModalDialog()</code> is currently being standardized as part of HTML5. The third argument (for additional options) is not present in the HTML5 version, and is (safely) ignored by both Safari and Chrome.</p>
+
+<h2 id="Specification" name="Specification">Specification</h2>
+
+<ul>
+ <li><code><a href="https://msdn.microsoft.com/en-us/library/ms536759%28VS.85%29.aspx?f=255&amp;MSPPError=-2147217396">showModalDialog()</a></code></li>
+ <li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dialogs-implemented-using-separate-documents">HTML5 Dialogs implemented using separate documents</a></li>
+</ul>