JavaScript Indexing

settings_applicationsEventTarget  >   settings_applicationsNode  >   settings_applicationsElement  >   settings_applications[[Prototype]]

{object_name}

Editing

scrollBy(Numberx-coords, Numbery-coords | Objectoptions)

Details

지정된 좌표를 상대적인 값으로 사용하여 스크롤한다.

구문

형식
element.scrollBy(x-coords, y-coords)

 상대적으로 스크롤될 x, y 좌표값을 지정한다.

형식
element.scrollBy(options);

매개 변수

Use of parameters type 1
Numberx-coords필수

상대적 스크롤에 사용될 수평 방향 픽셀 값을 지정한다.

Numbery-coords필수

상대적 스크롤에 사용될 수직 방향 픽셀 값을 지정한다.

Use of parameters type 2
Objectoptions필수

다음 아래의 속성을 가진 객체로 지정한다.

  • left : 상대적으로 스크롤될 수평 방향 픽셀 값을 지정한다.
  • top: 상대적으로 스크롤될 수직 방향 픽셀 값을 지정한다.
  • behavior : 스크롤 방법을 'auto', 'smooth' 중에서 선택한다. 'smooth'를 선택하면 부드럽게 스크롤되고 'auto'는 즉시 스크롤된다. 선택적인 값이며 기본 값은 'auto'이다.

지원 웹브라우저