JAVASCRIPT
Drop elements around
All samples are using Ink.requireModules
, please read how to use it at Ink.requireModules section
Function name | Description |
---|---|
.add(element, [options]) | Makes an element droppable. |
.remove(el) | Removes an element from the droppable stack and removes the droppable behavior |
.update(element) | Updates location and size of droppable element |
Makes an element droppable.
This method adds it to the stack of droppable elements.
Can consider it a constructor of droppable elements, but where no Droppable object is returned.
The onHover, onDrop, and onDropOut options below can be:
element
Target elementoptions
Options objectoptions.hoverClass
Classname(s) applied when an acceptable draggable element is hovering the elementoptions.accept
Selector for choosing draggables which can be dropped in this droppable.options.onHover
Called when an acceptable element is hovering the droppable (see above for string options).options.onDrop
Called when an acceptable element is dropped (see above for string options).options.onDropOut
Called when a droppable is dropped outside this droppable (see above for string options).Demo
Drag the elements between the dropabble boxes
Droppable box
Droppable box
Code
Removes an element from the droppable stack and removes the droppable behavior
el
Droppable element to disable.Updates location and size of droppable element
element
Target element