diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/window/copy_event | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/window/copy_event')
-rw-r--r-- | files/zh-cn/web/api/window/copy_event/index.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/window/copy_event/index.html b/files/zh-cn/web/api/window/copy_event/index.html new file mode 100644 index 0000000000..b2797de03e --- /dev/null +++ b/files/zh-cn/web/api/window/copy_event/index.html @@ -0,0 +1,72 @@ +--- +title: 'Window: copy event' +slug: Web/API/Window/copy_event +tags: + - API + - Clippboard API + - copy +translation_of: Web/API/Window/copy_event +--- +<div>{{APIRef}}</div> + +<p><span class="seoSummary">当用户通过浏览器的用户界面启动复制操作时,将触发 <strong><code>copy</code></strong> 事件。</span></p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Bubbles(支持冒泡)</th> + <td>Yes</td> + </tr> + <tr> + <th scope="row">Cancelable(可撤销)</th> + <td>Yes</td> + </tr> + <tr> + <th scope="row">Interface(接口)</th> + <td>{{domxref("ClipboardEvent")}}</td> + </tr> + <tr> + <th scope="row">Event handler property(事件处理程序属性)</th> + <td>{{domxref("HTMLElement/oncopy", "oncopy")}}</td> + </tr> + </tbody> +</table> + +<p>此事件的原始目标是 {{domxref("Element")}} 它是复制操作的预期目标。您可以在 {{domxref("Window")}} 界面上监听此事件,以在捕获或冒泡阶段对其进行处理。 有关此事件的完整详细信息,请参见 <a href="/en-US/docs/Web/API/Element/copy_event">Element: copy event</a>.</p> + +<h2 id="示例">示例</h2> + +<pre class="brush: js">window.addEventListener('copy', (event) => { + console.log('copy action initiated') +});</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Clipboard API', '#clipboard-event-copy')}}</td> + <td>{{Spec2('Clipboard API')}}</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + + + +<p>{{Compat("api.Window.copy_event")}}</p> + +<h2 id="参考">参考</h2> + +<ul> + <li>相关联事件:{{domxref("Window/cut_event", "cut")}}, {{domxref("Window/paste_event", "paste")}}</li> + <li>{{domxref("Element")}} 目标上的这个事件: {{domxref("Element/copy_event", "copy")}}</li> + <li>{{domxref("Document")}} 目标上的这个事件: {{domxref("Document/copy_event", "copy")}}</li> +</ul> |