From 03385cc9f4f157cec2e5fd05f35e6af646055908 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 14 Sep 2021 11:07:46 +0900 Subject: Web/API以下の文書内のリンクURLを正規化 (#2360) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /en-US へのリンクを /ja へのリンクに修正 - /ja が付いていないものに /ja を付加 - MDN内のリンクが完全URLの場合、 /ja/docs からのURLに修正 --- .../intersection_observer_api/timing_element_visibility/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/ja/web/api/intersection_observer_api') diff --git a/files/ja/web/api/intersection_observer_api/timing_element_visibility/index.html b/files/ja/web/api/intersection_observer_api/timing_element_visibility/index.html index 42f9db568a..b2da47c169 100644 --- a/files/ja/web/api/intersection_observer_api/timing_element_visibility/index.html +++ b/files/ja/web/api/intersection_observer_api/timing_element_visibility/index.html @@ -23,7 +23,7 @@ translation_of: Web/API/Intersection_Observer_API/Timing_element_visibility

サイト構造:HTML

-

The site's structure is not too complicated. We'll be using CSS Grid to style and lay out the site, so we can be pretty straightforward here:

+

The site's structure is not too complicated. We'll be using CSS Grid to style and lay out the site, so we can be pretty straightforward here:

<div class="wrapper">
   <header>
@@ -249,7 +249,7 @@ function startup() {
 
 

ドキュメントの可視性の変更の処理

-

Let's take a look at the handler for the {{event("visibilitychange")}} event. Our script receives this event when the document itself becomes visible or invisible. The most important scenario here is when the user switches tabs. Since Intersection Observer only cares about the intersection between the targeted elements and the intersection root, and not the tab's visibility (which is a different issue entirely), we need to use the Page Visibility API to detect these tab switches and disable our timers for the duration.

+

Let's take a look at the handler for the {{event("visibilitychange")}} event. Our script receives this event when the document itself becomes visible or invisible. The most important scenario here is when the user switches tabs. Since Intersection Observer only cares about the intersection between the targeted elements and the intersection root, and not the tab's visibility (which is a different issue entirely), we need to use the Page Visibility API to detect these tab switches and disable our timers for the duration.

function handleVisibilityChange() {
   if (document.hidden) {
-- 
cgit v1.2.3-54-g00ecf