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
Copy file name to clipboardExpand all lines: 2-ui/3-event-details/4-mouse-drag-and-drop/article.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ So here we'll see how to implement Drag'n'Drop using mouse events. Not that hard
15
15
The basic Drag'n'Drop algorithm looks like this:
16
16
17
17
1. Catch `mousedown` on a draggable element.
18
-
2. Prepare the element to moving (maybe create a copy of it or whatever).
18
+
2. Prepare the element for moving (maybe create a copy of it or whatever).
19
19
3. Then on `mousemove` move it by changing `left/top` and `position:absolute`.
20
20
4. On `mouseup` (button release) -- perform all actions related to a finished Drag'n'Drop.
21
21
@@ -58,7 +58,7 @@ ball.onmousedown = function(event) { // (1) start the process
58
58
};
59
59
```
60
60
61
-
If we run the code, we can notice something strange. On the beginning of the drag'n'drop, the ball "forks": we start to dragging it's "clone".
61
+
If we run the code, we can notice something strange. On the beginning of the drag'n'drop, the ball "forks": we start dragging its "clone".
62
62
63
63
```online
64
64
Here's an example in action:
@@ -178,7 +178,7 @@ In action (inside `<iframe>`):
178
178
[iframe src="ball3" height=230]
179
179
```
180
180
181
-
The difference is especially noticeable if we drag the ball by it's right-bottom corner. In the previous example the ball "jumps" under the pointer. Now it fluently follows the cursor from the current position.
181
+
The difference is especially noticeable if we drag the ball by its right-bottom corner. In the previous example the ball "jumps" under the pointer. Now it fluently follows the cursor from the current position.
0 commit comments