From 321e9f39e87510a6317a1f9c5c993523294da4a5 Mon Sep 17 00:00:00 2001 From: alattalatta Date: Sun, 28 Nov 2021 21:47:30 +0900 Subject: Rewrite and add IntersectionObserver methods --- .../ko/web/api/intersectionobserver/root/index.md | 60 +++++++++------------- 1 file changed, 25 insertions(+), 35 deletions(-) (limited to 'files/ko/web/api/intersectionobserver/root/index.md') diff --git a/files/ko/web/api/intersectionobserver/root/index.md b/files/ko/web/api/intersectionobserver/root/index.md index ad74686576..085515d574 100644 --- a/files/ko/web/api/intersectionobserver/root/index.md +++ b/files/ko/web/api/intersectionobserver/root/index.md @@ -1,55 +1,45 @@ --- title: IntersectionObserver.root slug: Web/API/IntersectionObserver/root +tags: + - API + - Intersection Observer + - Intersection Observer API + - IntersectionObserver + - Property + - Reference translation_of: Web/API/IntersectionObserver/root --- -
{{APIRef("Intersection Observer API")}}
+{{APIRef("Intersection Observer API")}} -

{{domxref("IntersectionObserver")}} 인터페이스의 read-only 속성인 root는 옵저버의 타겟 엘리먼트가 속한 화면의 경계, 즉 {{Glossary("viewport")}}의 {{Glossary("bounding box")}} 처럼 취급되는 {{domxref("Element")}} 이나 {{domxref("Document")}} 를 식별합니다. 만일 rootnull 이라면 화면 경계는 실제 document viewport가 사용됩니다.

+{{domxref("IntersectionObserver")}} 인터페이스의 **`root`** 읽기 전용 속성은 {{glossary("bounding box", "바운딩 박스")}}를 주시 대상의 {{glossary("viewport", "뷰포트")}}로 취급하는 {{domxref("Element")}} 또는 {{domxref("Document")}}를 나타냅니다. -

문법

+`root`가 `null`이면 문서의 실제 뷰포트 바운딩 박스를 사용합니다. -
var root = intersectionObserver.root;
-
+## 값 -

Value

+대상 요소가 얼마나 보이는지 판별할 때, 그 뷰포트 경계로서 바운딩 박스를 가져오는 {{domxref("Element")}} 또는 {{domxref("Document")}} 객체입니다. -

{{domxref("Element")}} 이나 {{domxref("Document")}} 객체로, 해당 객체의 bounding box는 observer에 의해 관찰되는 대상 요소가 화면상에 얼마나 보여지는가를 가늠할 뷰포트의 경계로 사용됩니다.

+이 뷰포트 경계에 {{domxref("IntersectionObserver.IntersectionObserver", "IntersectionObserver()")}} 생성자로 제공한 여백 설정을 적용한 직사각형 영역과, 대상 요소의 경계에서 그 위에 겹치는 다른 요소의 경계를 뺐을 때의 직사각형 영역을 대상 요소에서 볼 수 있는 영역으로 취급합니다. -

사각형 경계의 교차성, {{domxref("IntersectionObserver.IntersectionObserver", "IntersectionObserver()")}} 객체 생성시에 설정된 임의의 margin에 의한 offset, 대상 요소의 경계에서 타겟 요소와 겹쳐진 모든 요소나 다른 객체의 경계를 제외한 것이 대상 요소의 가시성 계산에 고려됩니다.

+`root`가 `null`이면 현재 문서를 루트로, 그 뷰포트(문서에서 지금 보이는 영역)를 루트 경계로 사용합니다. -

만일 rootnull이라면 현재 document가 root로 사용되며, 그것의 viewport의 경계(즉 document의 노출 영역)가 root 의 경계로 사용됩니다.

+## 예제 -

사용예

+CSS {{cssxref("border")}} 속성을 사용해서 교차 감지기의 루트 요소에 2픽셀 초록색 테두리를 추가하는 예제입니다. -

이 예제는 intersection observer의 root 요소의 {{cssxref("border")}}를 2픽셀 너비의 녹색 라인으로 설정합니다.

+```js +observer.root.style.border = "2px solid #44aa44"; +``` -
observer.root.style.border = "2px solid #44aa44";
-
+## 명세 -

Specifications

+{{Specifications}} - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('IntersectionObserver', '#dom-intersectionobserver-root', 'IntersectionObserver')}}{{Spec2('IntersectionObserver')}}Initial definition
+## 브라우저 호환성 -

Browser compatibility

+{{Compat}} -

{{Compat("api.IntersectionObserver.root")}}

+## 같이 보기 -

See also

- - +- [Intersection Observer API로 요소가 보여진 시간 측정하기](/ko/docs/Web/API/Intersection_Observer_API/Timing_element_visibility) -- cgit v1.2.3-54-g00ecf