Skip to content

Commit f71c4b9

Browse files
authored
Merge pull request #184 from msisaifu/introductions-to-browser-events
Introduction to browser events
2 parents d315298 + 32e7ba6 commit f71c4b9

File tree

7 files changed

+123
-127
lines changed

7 files changed

+123
-127
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
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/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">` কে অদৃশ্য করবে।
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` ব্যবহারের মাধ্যমে করতে পারি "কেননা `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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ importance: 5
44

55
# Hide self
66

7-
Create a button that hides itself on click.
7+
একটি বাটন লিখুন যেটি ক্লিক করলে বাটনটিই অদৃশ্য হয়ে যাবে।
88

99
```online
1010
Like this:
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` এর মাধ্যমে হ্যান্ডেলারটি রিমুভ হবে না। কোন হ্যান্ডেলার রিমুভ করতে আমাদের সেম ভ্যারিয়েবল ফাংশন অথবা ফাংশন পাঠাতে হবে। কিন্তু এখানে একই লজিকের দুটি ফাংশন পাঠানো হচ্ছে, একই রেফারেন্সের না।
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+
আবার `addEventListener` এর পাশাপাশি `button.onclick` ও কাজ করবে।

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ 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.
8-
9-
Which handlers run on click after the following code? Which alerts show up?
7+
বাটন ক্লিকে এখানে কোন হ্যান্ডেলারটি রান হবে, এবং কোন অ্যালার্টটি শো হবে?
108

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

0 commit comments

Comments
 (0)