aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/element/show_event
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/element/show_event
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/element/show_event')
-rw-r--r--files/zh-cn/web/api/element/show_event/index.html77
1 files changed, 77 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/element/show_event/index.html b/files/zh-cn/web/api/element/show_event/index.html
new file mode 100644
index 0000000000..c38719c912
--- /dev/null
+++ b/files/zh-cn/web/api/element/show_event/index.html
@@ -0,0 +1,77 @@
+---
+title: show
+slug: Web/API/Element/show_event
+translation_of: Web/API/Element/show_event
+---
+<p>当一个具有contextmenu属性的元素的contextmenu事件触发或冒泡到该元素时,show事件会被触发。</p>
+
+<h2 id="基本信息">基本信息</h2>
+
+<dl>
+ <dt style="float: left; text-align: right; width: 120px;">标准</dt>
+ <dd style="margin: 0 0 0 120px;"><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus">HTML5</a></dd>
+ <dt style="float: left; text-align: right; width: 120px;">接口</dt>
+ <dd style="margin: 0 0 0 120px;">Event</dd>
+ <dt style="float: left; text-align: right; width: 120px;">冒泡</dt>
+ <dd style="margin: 0 0 0 120px;">否</dd>
+ <dt style="float: left; text-align: right; width: 120px;">可关闭</dt>
+ <dd style="margin: 0 0 0 120px;">否</dd>
+ <dt style="float: left; text-align: right; width: 120px;">触发对象</dt>
+ <dd style="margin: 0 0 0 120px;">Element</dd>
+ <dt style="float: left; text-align: right; width: 120px;">默认动作</dt>
+ <dd style="margin: 0 0 0 120px;">显示由相关目录元素创建的上下文目录</dd>
+</dl>
+
+<h2 id="属性">属性</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">属性</th>
+ <th scope="col">类型</th>
+ <th scope="col">描述</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><code>target</code> {{readonlyInline}}</td>
+ <td>{{domxref("EventTarget")}}</td>
+ <td>事件的目标对象 (DOM树中的最高层元素)。</td>
+ </tr>
+ <tr>
+ <td><code>type</code> {{readonlyInline}}</td>
+ <td>{{domxref("DOMString")}}</td>
+ <td>事件类型。</td>
+ </tr>
+ <tr>
+ <td><code>bubbles</code> {{readonlyInline}}</td>
+ <td>{{jsxref("Boolean")}}</td>
+ <td>事件是否冒泡。</td>
+ </tr>
+ <tr>
+ <td><code>cancelable</code> {{readonlyInline}}</td>
+ <td>{{jsxref("Boolean")}}</td>
+ <td>事件是否可以关闭。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush:html;">&lt;div contextmenu="test"&gt;&lt;/div&gt;
+&lt;menu type="context" id="test"&gt;
+    &lt;menuitem label="alert" onclick="alert('the alert label has been clicked')" /&gt;
+&lt;/menu&gt;
+
+&lt;script&gt;
+  document.getElementById("test").addEventListener("show", function(e){
+    alert("the context menu will be displayed");
+  }, false);
+&lt;/script&gt;
+</pre>
+
+<h2 id="相关事件">相关事件</h2>
+
+<ul>
+ <li><a href="https://developer.mozilla.org/en-US/Mozilla_event_reference/contextmenu"><code>contextmenu</code></a></li>
+</ul>