Skip to content

Commit 27c9d6a

Browse files
authored
Merge pull request #239 from vplentinax/sync-ui-events
sync-ui-events
2 parents c33eaa9 + 5508b8f commit 27c9d6a

File tree

21 files changed

+209
-570
lines changed

21 files changed

+209
-570
lines changed

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 "itself" here:
1+
Can use `this` in the handler to reference "the element itself" here:
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/04-move-ball-field/move-ball-coords.svg

Lines changed: 1 addition & 51 deletions
Loading

2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Then the ball will be positioned relatively to the field:
2222
}
2323
```
2424

25-
Next we need to assign the correct `ball.style.position.left/top`. They contain field-relative coordinates now.
25+
Next we need to assign the correct `ball.style.left/top`. They contain field-relative coordinates now.
2626

2727
Here's the picture:
2828

@@ -36,7 +36,7 @@ To get field-relative `left` coordinate of the click, we can substract the field
3636
let left = event.clientX - fieldCoords.left - field.clientLeft;
3737
```
3838

39-
Normally, `ball.style.position.left` means the "left edge of the element" (the ball). So if we assign that `left`, then the ball edge would be under the mouse cursor.
39+
Normally, `ball.style.left` means the "left edge of the element" (the ball). So if we assign that `left`, then the ball edge, not center, would be under the mouse cursor.
4040

4141
We need to move the ball half-width left and half-height up to make it center.
4242

2-ui/2-events/01-introduction-browser-events/05-sliding-menu/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Like this:
2929

3030
So if we set `onclick` on it, then it will catch clicks to the right of the text.
3131

32-
...but `<span>` has an implicit `display: inline`, so it occupies exactly enough place to fit all the text:
32+
As `<span>` has an implicit `display: inline`, it occupies exactly enough place to fit all the text:
3333

3434
```html autorun height=50
3535
<span style="border: solid red 1px" onclick="alert(1)">Sweeties (click me)!</span>
Lines changed: 1 addition & 31 deletions
Loading
Lines changed: 1 addition & 33 deletions
Loading

2-ui/2-events/01-introduction-browser-events/07-carousel/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The images ribbon can be represented as `ul/li` list of images `<img>`.
22

3-
Normally, such a ribbon is wide, but we put a fixed-size `<div>` around to "cut" it, so that only a part of the ribbon is visibble:
3+
Normally, such a ribbon is wide, but we put a fixed-size `<div>` around to "cut" it, so that only a part of the ribbon is visible:
44

55
![](carousel1.svg)
66

0 commit comments

Comments
 (0)