2.0.1 • Published 1 year ago

drag-drop-system v2.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Drag & Drop System

Simple, easy to use drag & drop system

NPM Package GitHub Repo

How it works

this system only relies on 3 scripts:

  • cSharpEvent.js: Creates C#-like action system
  • mouseEventHandler.js: Checks the DOM mouse events on the document body then triggers a C#-like event
  • dragHandler.js: Listens to the events triggered by mouseEventHandler.js, checks if the element is draggable, call dragElement() for the dragged element

How to use

  1. Make sure all the 3 scripts are initialized
  2. add the custom-draggable html class to elements you wish to be draggable
  3. add both custom-draggable and coward classes to elements you wish to not be directly draggable, instead create a clone of the element that will be dragged around, once you drop it, the original element will be appended by the droppable element
  4. add the custom-droppable html class to elements you wish to be a drop-box

FREE PALESTINE 🇵🇸

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago