From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- files/ko/web/api/element/scrollintoview/index.html | 88 ++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 files/ko/web/api/element/scrollintoview/index.html (limited to 'files/ko/web/api/element/scrollintoview') diff --git a/files/ko/web/api/element/scrollintoview/index.html b/files/ko/web/api/element/scrollintoview/index.html new file mode 100644 index 0000000000..1736aa2e40 --- /dev/null +++ b/files/ko/web/api/element/scrollintoview/index.html @@ -0,0 +1,88 @@ +--- +title: element.scrollIntoView +slug: Web/API/Element/scrollIntoView +translation_of: Web/API/Element/scrollIntoView +--- +
+

{{APIRef("DOM")}}

+ + + +

{{domxref("Element")}} 인터페이스의 scrollIntoView() 메소드는 scrollIntoView()가 호출 된 요소가 사용자에게 표시되도록 요소의 상위 컨테이너를 스크롤합니다.

+
+ +

문법

+ +
element.scrollIntoView();
+element.scrollIntoView(alignToTop); // Boolean parameter
+element.scrollIntoView(scrollIntoViewOptions); // Object parameter
+ +
+
+

Parameters

+
+
alignToTop {{optional_inline}}
+
{{jsxref("Boolean")}} 값: +
    +
  • true일때, the top of the element will be aligned to the top of the visible area of the scrollable ancestor. Corresponds to scrollIntoViewOptions: {block: "start", inline: "nearest"}. This is the default value.
  • +
  • false일때, the bottom of the element will be aligned to the bottom of the visible area of the scrollable ancestor. Corresponds to scrollIntoViewOptions: {block: "end", inline: "nearest"}.
  • +
+
+
scrollIntoViewOptions {{optional_inline}} {{experimental_inline}}
+
다음의 프로퍼티를 가지는 객체
+
+
+
behavior {{optional_inline}}
+
전환에니메이션을 정의.
+ "auto""smooth"중 하나 선택. 기본값은 "auto".
+
block {{optional_inline}}
+
수직 정렬을 정의
+ "start""center""end""nearest"중 하나 선택. 기본값은 "start".
+
inline {{optional_inline}}
+
수평 정렬을 정함
+ One of "start""center""end""nearest"중 하나 선택. 기본값은 "nearest".
+
+
+
+ +

예제

+ +
var element = document.getElementById("box");
+
+element.scrollIntoView();
+element.scrollIntoView(false);
+element.scrollIntoView({block: "end"});
+element.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"});
+ +

Notes

+ + + +

다른 요소의 레이아웃에 따라 위쪽 또는 아래쪽으로 완전히 스크롤되지 않을 수 있습니다.

+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("CSSOM View", "#dom-element-scrollintoview", "Element.scrollIntoView()")}}{{Spec2("CSSOM View")}}Initial definition
+ +

브라우저 호환성

+ +

{{Compat("api.Element.scrollIntoView")}}

+ +

더보기

+ + -- cgit v1.2.3-54-g00ecf