diff options
| author | MDN <actions@users.noreply.github.com> | 2022-03-08 00:12:08 +0000 |
|---|---|---|
| committer | MDN <actions@users.noreply.github.com> | 2022-03-08 00:12:08 +0000 |
| commit | d53bae971e455859229bcb3246e29bcbc85179d2 (patch) | |
| tree | 396c8a403d46802b365aa8d26183f6b18f2a1c6e /files/zh-cn/conflicting/web | |
| parent | 0c6e68897d9b4182437d58e376dbb48ee6947f71 (diff) | |
| download | translated-content-d53bae971e455859229bcb3246e29bcbc85179d2.tar.gz translated-content-d53bae971e455859229bcb3246e29bcbc85179d2.tar.bz2 translated-content-d53bae971e455859229bcb3246e29bcbc85179d2.zip | |
[CRON] sync translated content
Diffstat (limited to 'files/zh-cn/conflicting/web')
| -rw-r--r-- | files/zh-cn/conflicting/web/api/document/visibilitychange_event/index.html | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/files/zh-cn/conflicting/web/api/document/visibilitychange_event/index.html b/files/zh-cn/conflicting/web/api/document/visibilitychange_event/index.html new file mode 100644 index 0000000000..e79fcf4cf9 --- /dev/null +++ b/files/zh-cn/conflicting/web/api/document/visibilitychange_event/index.html @@ -0,0 +1,54 @@ +--- +title: Document.onvisibilitychange +slug: conflicting/Web/API/Document/visibilitychange_event +translation_of: Web/API/Document/onvisibilitychange +original_slug: Web/API/Document/onvisibilitychange +--- +<div>{{ApiRef('DOM')}}</div> + +<p><code><strong>Document.onvisibilitychange</strong></code> 是一个事件处理方法,它将在该对象的 <code><strong>visibilitychange</strong></code>事件被触发时调用。</p> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox"><em>obj</em>.onvisibilitychange = <em>function</em>; +</pre> + +<ul> + <li><code>function</code> 是一个用户定义的方法的名字(而非带()和任何参数的函数调用),或者匿名函数的申明。</li> +</ul> + +<h2 id="例子">例子</h2> + +<pre class="brush: js">document.onvisibilitychange = function() { + console.log("Visibility of page has changed!"); +}; +</pre> + +<h2 id="标准">标准</h2> + +<table class="spectable standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Page Visibility API','#onvisiblitychange-event-handler','onvisibilitychange')}}</td> + <td>{{Spec2('Page Visibility API')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + + + +<p>{{Compat("api.Document.onvisibilitychange")}}</p> + +<h2 id="另见">另见</h2> + +<ul> + <li><a href="/en-US/docs/Web/API/Page_Visibility_API">Page Visibility API</a></li> +</ul> |
