From 9cf824dab074e4ad9d5bab95d0c7cf712bca8eb3 Mon Sep 17 00:00:00 2001 From: HARRY <78300703+sksskdf@users.noreply.github.com> Date: Mon, 12 Dec 2022 10:09:15 +0900 Subject: [PATCH] korean translate --- 2-ui/3-event-details/8-onscroll/article.md | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/2-ui/3-event-details/8-onscroll/article.md b/2-ui/3-event-details/8-onscroll/article.md index 734bd84c61..189a78c92f 100644 --- a/2-ui/3-event-details/8-onscroll/article.md +++ b/2-ui/3-event-details/8-onscroll/article.md @@ -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. +예시로 : +- 추가적인 제어나 정보등을 문서상 유저의 위치에 따라 숨기거나 보여줄 수 있습니다. +- 유저가 스크롤하여 페이지의 끝에 도달할 때 까지 추가적인 데이터를 불러옵니다. -Here's a small function to show the current scroll: +현재 스크롤을 보여주는 간단한 함수입니다. ```js autorun window.addEventListener('scroll', function() { @@ -20,18 +20,17 @@ In action: Current scroll = scroll the window ``` -The `scroll` event works both on the `window` and on scrollable elements. +`scroll` 이벤트는 `window` 와 스크롤 가능한 요소 둘 다에 발생합니다. -## Prevent scrolling +## 스크롤 막기 -How do we make something unscrollable? +무언가를 스크롤 불가능하게 만드려면 어떻게 해야 할까요? -We can't prevent scrolling by using `event.preventDefault()` in `onscroll` listener, because it triggers *after* the scroll has already happened. +`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` 이벤트엔 위와 같은 방법이 유효합니다. -If we add an event handler to these events and `event.preventDefault()` in it, then the scroll won't start. +이러한 키보드 이벤트에 `event.preventDefault()` 코드로 스크롤이 발생하지 않게 할 수 있습니다. -There are many ways to initiate a scroll, so it's more reliable to use CSS, `overflow` property. - -Here are few tasks that you can solve or look through to see applications of `onscroll`. +스크롤을 발생시키는데에는 위 두가지 방법 외에도 다양한 방법들이 있습니다. +그러므로 CSS의 `overflow` 속성을 이용하는 방법이 좀 더 안전할 수 있습니다.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: