You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current scroll = <b id="showScroll">scroll the window</b>
20
+
현재 스크롤 위치 = <b id="showScroll">scroll the window</b>
21
21
```
22
22
23
-
The `scroll`event works both on the `window` and on scrollable elements.
23
+
`scroll`이벤트는 `window`와 스크롤 가능한 요소에서 동작합니다.
24
24
25
-
## Prevent scrolling
25
+
## 스크롤 방지
26
26
27
-
How do we make something unscrollable?
27
+
어떻게 스크롤이 불가능하도록 할 수 있을까요?
28
28
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 리스너가 스크롤이 이미 발생한 뒤에 동작하기 때문에 불가능합니다.
30
30
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()`로 스크롤이 동작하는 것을 방지할 수 있습니다.
32
32
33
-
If we add an event handler to these events and `event.preventDefault()` in it, then the scroll won't start.
33
+
이와 같은 이벤트에 이벤트 핸들러와 `event.preventDefault()`를 추가한다면 스크롤은 시작되지 않습니다.
34
34
35
-
There are many ways to initiate a scroll, so it's more reliable to use CSS, `overflow` property.
35
+
스크롤을 일으키는 방법은 많습니다. 그렇기 때문에 CSS의 `overflow` 프로퍼티를 사용하는 것이 더 안전합니다.
36
36
37
-
Here are few tasks that you can solve or look through to see the applications on `onscroll`.
37
+
다음은 `onscroll`이 적용된 애플리케이션을 이해하기 위해 해결하거나 살펴볼 수 있는 몇 가지 과제입니다.
0 commit comments