-
Notifications
You must be signed in to change notification settings - Fork 842
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
base: master
Are you sure you want to change the base?
Part2 3.6 Scrolling 번역 #1554
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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. | ||||||||||
예시: | ||||||||||
- 문서의 위치에 따라 추가 컨트롤 또는 정보를 표시하거나 숨깁니다. | ||||||||||
- 사용자가 페이지 끝까지 스크롤 할 때 더 많은 데이터를 로드합니다. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
Here's a small function to show the current scroll: | ||||||||||
다음은 현재 스크롤을 표시하는 작은 함수입니다. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
```js autorun | ||||||||||
window.addEventListener('scroll', function() { | ||||||||||
|
@@ -15,23 +15,23 @@ window.addEventListener('scroll', function() { | |||||||||
``` | ||||||||||
|
||||||||||
```online | ||||||||||
In action: | ||||||||||
동작 중: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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` 와 스크롤이 가능한 요소 모두에서 작동합니다. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
## Prevent scrolling | ||||||||||
## 스크롤 방지 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
How do we make something unscrollable? | ||||||||||
어떻게 통제할 수 없는 것을 만들 수 있을까요? | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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()`를 사용하여 스크롤을 방지할 수 없습니다. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
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()`로 스크롤 하지 않도록 할 수 있습니다. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
If we add an event handler to these events and `event.preventDefault()` in it, then the scroll won't start. | ||||||||||
이벤트 핸들러를 이러한 이벤트와 이벤트 핸들러의 `event.preventDefault()`에 추가하면 스크롤이 시작되지 않습니다. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Suggested change
|
||||||||||
|
||||||||||
There are many ways to initiate a scroll, so it's more reliable to use CSS, `overflow` property. | ||||||||||
스크롤을 시작하는 방법은 여러 가지가 있으므로 CSS, `overflow` 프로퍼티를 사용하는 것이 더 안정적입니다. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
Here are few tasks that you can solve or look through to see applications of `onscroll`. | ||||||||||
다음은 `onscroll`의 애플리케이션을 보기 위해 해결하거나 살펴볼 수 있는 몇 가지 과제입니다. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.