This commit is contained in:
Ilya Kantor 2019-11-10 09:04:59 +03:00
parent be244d03b2
commit 2b5ac971c1

View file

@ -6,9 +6,9 @@ In the modern HTML standard there's a [section about Drag and Drop](https://html
They are interesting because they allow to solve simple tasks easily, and also allow to handle drag'n'drop of "external" files into the browser. So we can take a file in the OS file-manager and drop it into the browser window. Then JavaScript gains access to its contents. They are interesting because they allow to solve simple tasks easily, and also allow to handle drag'n'drop of "external" files into the browser. So we can take a file in the OS file-manager and drop it into the browser window. Then JavaScript gains access to its contents.
But native Drag Events also have limitations. For instance, we can't limit dragging by a certain area. Also we can't make it "horizontal" or "vertical" only. There are other drag'n'drop tasks that can't be done using that API. But native Drag Events also have limitations. For instance, we can't limit dragging by a certain area. Also we can't make it "horizontal" or "vertical" only. There are other drag'n'drop tasks that can't be done using that API. Besides, mobile devices support for such events is almost non-existant.
Here we'll see how to implement Drag'n'Drop using mouse events. So here we'll see how to implement Drag'n'Drop using mouse events.
## Drag'n'Drop algorithm ## Drag'n'Drop algorithm