Simple JavaScript drag and drop witout the help of a library

后端 未结 4 812
我寻月下人不归
我寻月下人不归 2021-02-09 07:13

I am simply looking for a way of using drag and drop without jquery or any other library. If a dragged object is dropped on another element the later element should start an eve

4条回答
  •  我在风中等你
    2021-02-09 07:27

    Hmm. It's probably not that simple that you'd want to do it yourself, but I would look at Peter Michaux's FORK Javascript drag and drop library -- unlike JQuery or all those big libraries, FORK's modules are decoupled from each other, and are simple enough that you could probably look at Peter's source code and figure out the bits you need. (edit: I'd just use FORK.Drag as it's really small: 7.6KB total minified)

提交回复
热议问题