Skip to content

Commit 15a9ebf

Browse files
marco0332이기인
authored and
이기인
committed
[내용번역] Part 2. 3.5 Scrolling
1 parent 728647e commit 15a9ebf

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed
+16-16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Scrolling
1+
# 스크롤
22

3-
The `scroll` event allows to react on a page or element scrolling. There are quite a few good things we can do here.
3+
`scroll` 이벤트는 페이지 혹은 요소에서 스크롤 했을 경우 반응할 수 있게 해줍니다. 우리가 해볼 수 있는 몇 가지 좋은 사례들이 있습니다.
44

5-
For instance:
6-
- Show/hide additional controls or information depending on where in the document the user is.
7-
- Load more data when the user scrolls down till the end of the page.
5+
예시:
6+
- 문서에서 사용자의 위치에 따라 추가 제어 요소 또는 정보를 표시하거나 숨긴다.
7+
- 사용자가 페이지 끝까지 스크롤을 내릴 경우 더 많은 데이터를 불러온다.
88

9-
Here's a small function to show the current scroll:
9+
다음은 현재 스크롤 위치를 출력하는 간단한 함수입니다.
1010

1111
```js autorun
1212
window.addEventListener('scroll', function() {
@@ -15,23 +15,23 @@ window.addEventListener('scroll', function() {
1515
```
1616

1717
```online
18-
In action:
18+
작동 중:
1919
20-
Current scroll = <b id="showScroll">scroll the window</b>
20+
현재 스크롤 위치 = <b id="showScroll">scroll the window</b>
2121
```
2222

23-
The `scroll` event works both on the `window` and on scrollable elements.
23+
`scroll` 이벤트는 `window`와 스크롤 가능한 요소에서 동작합니다.
2424

25-
## Prevent scrolling
25+
## 스크롤 방지
2626

27-
How do we make something unscrollable?
27+
어떻게 스크롤이 불가능하도록 할 수 있을까요?
2828

29-
We can't prevent scrolling by using `event.preventDefault()` in `onscroll` listener, because it triggers *after* the scroll has already happened.
29+
`onscroll` 리스너에서 `event.preventDefault()`로 스크롤을 막는 것은 onscroll 리스너가 스크롤이 이미 발생한 뒤에 동작하기 때문에 불가능합니다.
3030

31-
But we can prevent scrolling by `event.preventDefault()` on an event that causes the scroll, for instance `keydown` event for `key:pageUp` and `key:pageDown`.
31+
하지만 `key:pageUp`이나 `key:pageDown`과 같은 `keydown` 이벤트처럼 스크롤을 일으키는 이벤트의 경우에는 `event.preventDefault()`로 스크롤이 동작하는 것을 방지할 수 있습니다.
3232

33-
If we add an event handler to these events and `event.preventDefault()` in it, then the scroll won't start.
33+
이와 같은 이벤트에 이벤트 핸들러와 `event.preventDefault()`를 추가한다면 스크롤은 시작되지 않습니다.
3434

35-
There are many ways to initiate a scroll, so it's more reliable to use CSS, `overflow` property.
35+
스크롤을 일으키는 방법은 많습니다. 그렇기 때문에 CSS의 `overflow` 프로퍼티를 사용하는 것이 더 안전합니다.
3636

37-
Here are few tasks that you can solve or look through to see the applications on `onscroll`.
37+
다음은 `onscroll`이 적용된 애플리케이션을 이해하기 위해 해결하거나 살펴볼 수 있는 몇 가지 과제입니다.

0 commit comments

Comments
 (0)