fix
This commit is contained in:
parent
809cebcd04
commit
ee4a91e56c
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ ball.style.left = pageX - ball.offsetWidth / 2 + 'px';
|
||||||
ball.style.top = pageY - ball.offsetHeight / 2 + 'px';
|
ball.style.top = pageY - ball.offsetHeight / 2 + 'px';
|
||||||
```
|
```
|
||||||
|
|
||||||
Not bad, but there's a side-effect. To initiate the drag'n'drop can we `mousedown` anywhere on the ball. If do it at the edge, then the ball suddenly "jumps" to become centered.
|
Not bad, but there's a side-effect. To initiate the drag'n'drop, we can `mousedown` anywhere on the ball. But if do it at the edge, then the ball suddenly "jumps" to become centered.
|
||||||
|
|
||||||
It would be better if we keep the initial shift of the element relative to the pointer.
|
It would be better if we keep the initial shift of the element relative to the pointer.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue