This commit is contained in:
Peter Kampjes 2020-08-07 22:56:07 -03:00 committed by GitHub
parent 7907cd667c
commit beaf89f608
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,7 +276,7 @@ function onMouseMove(event) {
} }
``` ```
In the example below when the ball is dragged over the soccer gate, the gate is highlighted. In the example below when the ball is dragged over the soccer goal, the goal is highlighted.
[codetabs height=250 src="ball4"] [codetabs height=250 src="ball4"]
@ -300,4 +300,4 @@ We can lay a lot on this foundation.
- We can use event delegation for `mousedown/up`. A large-area event handler that checks `event.target` can manage Drag'n'Drop for hundreds of elements. - We can use event delegation for `mousedown/up`. A large-area event handler that checks `event.target` can manage Drag'n'Drop for hundreds of elements.
- And so on. - And so on.
There are frameworks that build architecture over it: `DragZone`, `Droppable`, `Draggable` and other classes. Most of them do the similar stuff to what's described above, so it should be easy to understand them now. Or roll your own, as you can see that that's easy enough to do, sometimes easier than adapting a third-part solution. There are frameworks that build architecture over it: `DragZone`, `Droppable`, `Draggable` and other classes. Most of them do the similar stuff to what's described above, so it should be easy to understand them now. Or roll your own, as you can see that that's easy enough to do, sometimes easier than adapting a third-party solution.