Skip to content

Commit 3219d54

Browse files
boyeonihnViolet-Bora-Lee
authored andcommitted
[신규 번역] Part 2 - 2.1 브라우저 이벤트 소개 과제 1-3 번역 (#1539)
1 parent 45458ba commit 3219d54

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

2-ui/2-events/01-introduction-browser-events/01-hide-other/solution.view/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
<body>
99

10-
<input type="button" id="hider" value="Click to hide the text" />
10+
<input type="button" id="hider" value="Text를 숨기려면 클릭하세요." />
1111

1212
<div id="text">Text</div>
1313

1414
<script>
15-
// Here it doesn't matter how we hide the text,
16-
// could also use style.display:
15+
// 텍스트를 숨기는 방법은 다양한데, 그 방법은 중요하지 않습니다.
16+
// style.display를 사용해도 됩니다.
1717
document.getElementById('hider').onclick = function() {
1818
document.getElementById('text').hidden = true;
1919
}

2-ui/2-events/01-introduction-browser-events/01-hide-other/source.view/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
<body>
99

10-
<input type="button" id="hider" value="Click to hide the text" />
10+
<input type="button" id="hider" value="Text를 숨기려면 클릭하세요." />
1111

1212
<div id="text">Text</div>
1313

1414
<script>
15-
/* your code */
15+
/* 코드를 여기에 작성하세요 */
1616
</script>
1717

1818
</body>

2-ui/2-events/01-introduction-browser-events/01-hide-other/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ importance: 5
22

33
---
44

5-
# Hide on click
5+
# 버튼 클릭 시 특정 요소 숨기기
66

7-
Add JavaScript to the `button` to make `<div id="text">` disappear when we click it.
7+
`button`을 클릭하면 `<div id="text">`가 사라지도록 `button`에 자바스크립트를 추가해봅시다.
88

9-
The demo:
9+
데모:
1010

1111
[iframe border=1 src="solution" height=80]

2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Can use `this` in the handler to reference "the element itself" here:
1+
핸들러 내부에 `this`를 사용해 '요소 자체'를 참조할 수 있습니다.
22

33
```html run height=50
44
<input type="button" onclick="this.hidden=true" value="Click to hide">

2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 5
22

33
---
44

5-
# Hide self
5+
# 클릭된 요소 숨기기
66

7-
Create a button that hides itself on click.
7+
클릭 시 자신을 숨기는 버튼을 만들어봅시다.
88

99
```online
10-
Like this:
10+
예시:
1111
<input type="button" onclick="this.hidden=true" value="Click to hide">
1212
```
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
The answer: `1` and `2`.
1+
정답: `1``2`가 얼럿 창에 표시됩니다.
22

3-
The first handler triggers, because it's not removed by `removeEventListener`. To remove the handler we need to pass exactly the function that was assigned. And in the code a new function is passed, that looks the same, but is still another function.
3+
`removeEventListener`가 있지만 첫 번째 핸들러는`removeEventListener`에 의해 지워지지 않았기 때문에 트리거됩니다. 핸들러를 삭제하려면 핸들러 할당 시 사용한 함수를 그대로 전달해주어야 합니다. `removeEventListener`에 첫 번째 핸들러의 함수와 똑같이 생긴 함수를 전달했지만, 엄연히 다른 함수이기 때문에 `removeEventListener`를 사용해도 첫 번째 이벤트 핸들러는 지워지지 않습니다.
44

5-
To remove a function object, we need to store a reference to it, like this:
5+
이미 등록한 핸들러 함수를 삭제하려면 다음과 같이 함수에 대한 참조를 저장해야 합니다.
66

77
```js
88
function handler() {
@@ -13,4 +13,4 @@ button.addEventListener("click", handler);
1313
button.removeEventListener("click", handler);
1414
```
1515

16-
The handler `button.onclick` works independently and in addition to `addEventListener`.
16+
핸들러 `button.onclick`은 독립적으로 동작합니다. 따라서 `addEventListener`와 함께 동작하였습니다.

2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 5
22

33
---
44

5-
# Which handlers run?
5+
# 어떤 핸들러가 실행될까요
66

7-
There's a button in the variable. There are no handlers on it.
7+
변수 안에 버튼이 있지만 버튼 처리를 담당하는 핸들러는 없다고 가정해봅시다.
88

9-
Which handlers run on click after the following code? Which alerts show up?
9+
이런 코드가 있는 경우에, 버튼 클릭시 실행되는 핸들러는 무엇일까요? 어떤 얼럿 창이 보일까요?
1010

1111
```js no-beautify
1212
button.addEventListener("click", () => alert("1"));

0 commit comments

Comments
 (0)