Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part2 3.6 Scrolling 번역 #1554

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions 2-ui/3-event-details/8-onscroll/article.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Scrolling
# 스크롤

The `scroll` event allows reacting to a page or element scrolling. There are quite a few good things we can do here.
`Scroll` 이벤트는 페이지 또는 요소 스크롤에 응답할 수 있습니다. 이 페이지에서 할 수 있는 좋은 예시가 꽤 많이 있습니다.

For instance:
- Show/hide additional controls or information depending on where in the document the user is.
- Load more data when the user scrolls down till the end of the page.
예시:
- 문서의 위치에 따라 추가 컨트롤 또는 정보를 표시하거나 숨깁니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 문서의 위치에 따라 추가 컨트롤 또는 정보를 표시하거나 숨깁니다.
- 사용사의 문서 내 위치에 따라 특정 코드를 실행시키거나 정보를 표시 혹은 숨길 수 있습니다.

- 사용자가 페이지 끝까지 스크롤 할 때 더 많은 데이터를 로드합니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 사용자가 페이지 끝까지 스크롤 할 때 더 많은 데이터를 로드합니다.
- 사용자가 페이지 맨 아래까지 스크롤을 내릴 경우, 추가 데이터를 로드합니다.


Here's a small function to show the current scroll:
다음은 현재 스크롤을 표시하는 작은 함수입니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
다음은 현재 스크롤을 표시하는 작은 함수입니다.
다음 함수는 현재 스크롤 위치를 표시해줍니다.


```js autorun
window.addEventListener('scroll', function() {
Expand All @@ -15,23 +15,23 @@ window.addEventListener('scroll', function() {
```

```online
In action:
동작 중:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
동작 중:
위 함수가 동작하도록 해 놓았기 때문에 다음과 같이 현재 스크롤 위치가 계속 업데이트되는것을 확인할 수 있습니다.


Current scroll = <b id="showScroll">scroll the window</b>
현재 스크롤 = <b id="showScroll">scroll the window</b>
```

The `scroll` event works both on the `window` and on scrollable elements.
`scroll` 이벤트는 `window` 와 스크롤이 가능한 요소 모두에서 작동합니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`scroll` 이벤트는 `window` 와 스크롤이 가능한 요소 모두에서 작동합니다.
`scroll` 이벤트는 `window`와 스크롤이 가능한 요소 모두에서 동작합니다.


## Prevent scrolling
## 스크롤 방지
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 스크롤 방지
## 스크롤 막기


How do we make something unscrollable?
어떻게 통제할 수 없는 것을 만들 수 있을까요?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
어떻게 통제할 수 없는 것을 만들 수 있을까요?
스크롤이 동작하지 않게 하려면 어떻게 해야 할까요?


We can't prevent scrolling by using `event.preventDefault()` in `onscroll` listener, because it triggers *after* the scroll has already happened.
스크롤이 이미 실행된 *후*에 트리거 되므로 `onscroll` Listener에서 `event.preventDefault()`를 사용하여 스크롤을 방지할 수 없습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
스크롤이 이미 실행된 **에 트리거 되므로 `onscroll` Listener에서 `event.preventDefault()`사용하여 스크롤을 방지할 수 없습니다.
`onscroll` 리스너는 스크롤이 움직인 **에 트리거 되므로 `event.preventDefault()`사용해도 스크롤을 막을 수 없습니다.


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`.
그러나 스크롤을 유발하는 이벤트(예시: `key:pageUp` 및 `key:pageDown`에 대한 `keydown` 이벤트)에 대해 `event.preventDefault()`로 스크롤 하지 않도록 할 수 있습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
그러나 스크롤을 유발하는 이벤트(예시: `key:pageUp``key:pageDown`에 대한 `keydown` 이벤트)에 대해 `event.preventDefault()`스크롤 하지 않도록 할 수 있습니다.
그런데 `key:pageUp``key:pageDown`같은 `keydown` 이벤트를 사용해 스크롤을 움직이는건 `event.preventDefault()`막을 수 있습니다.


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
이벤트 핸들러를 이러한 이벤트와 이벤트 핸들러의 `event.preventDefault()`에 추가하면 스크롤이 시작되지 않습니다.
이벤트 핸들러를 이러한 이벤트와 이벤트 핸들러의 `event.preventDefault()`에 추가하면 스크롤이 시작되지 않습니다.
Suggested change
이벤트 핸들러를 이러한 이벤트와 이벤트 핸들러의 `event.preventDefault()` 추가하면 스크롤이 시작되지 않습니다.
`keydown` 이벤트에 핸들러 있고, 이 핸들러에 `event.preventDefault()` 추가하면 스크롤을 움직이지 못하게 할 수 있습니다.


There are many ways to initiate a scroll, so it's more reliable to use CSS, `overflow` property.
스크롤을 시작하는 방법은 여러 가지가 있으므로 CSS, `overflow` 프로퍼티를 사용하는 것이 더 안정적입니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
스크롤을 시작하는 방법은 여러 가지가 있으므로 CSS, `overflow` 프로퍼티를 사용하는 것이 더 안정적입니다.
스크롤을 움직이게 하는 방법은 여러 가지가 있으므로 스크롤을 막으려면 CSS의 `overflow` 프로퍼티를 사용하는 걸 추천합니다.


Here are few tasks that you can solve or look through to see applications of `onscroll`.
다음은 `onscroll`의 애플리케이션을 보기 위해 해결하거나 살펴볼 수 있는 몇 가지 과제입니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
다음은 `onscroll`의 애플리케이션을 보기 위해 해결하거나 살펴볼 수 있는 몇 가지 과제입니다.
`scroll` `onscroll` 이벤트가 실무에서 어떻게 사용되는지는 다음 과제를 통해 학습해보세요.