This article is translated from:/programming/javascript/mk/column2/
All copyrights belong to the original text
Javascript is characterized by dom processing and web page effects. In most cases, we only use the simplest functions of this language, such as creating picture carousels/web page tabs, etc. This article will show you how to make drag and drop on your own web page.
There are many reasons to add drag and drop function to your website, the easiest one is data reorganization. For example: You have a sequence of contents for users to sort, and the user needs to enter each entry or use select to select. Instead of the previous method, drag and drop. Perhaps your website also needs a navigation window that users can drag! Then these effects are very simple: because you can easily achieve it!
It is actually not very complicated to implement drag and drop on a web page. First, you need to know the mouse coordinates, second, you need to know that the user clicks on a web page element with the mouse and drags, and finally we need to move this element.