Webanizr Logo
Open / sluit menu
Module dragAndDrop

Last change: September 30, 2019

Current version: 1.1.1

The dragAndDrop module helps to re-order specified items in a list by dragging and dropping. Dragged item is only droppable on top or bottom of an item in the same list.

syntax

webanizr.collect('dragAndDrop', parameters, callback);

parameters

The collect method of dragAndDrop accepts the following three parameters.

selector_listitems (required)

Dom element selector of the list items. Uses querySelectorAll function via domEvents module.

style__ordering (optional)

Type of ordering style. It can be either beforedrop or afterdrop. afterdrop orders the items in the list after the dragging event is over. beforedrop orders the items in the list immediately while dragging an item.

callback

The function to pass the data onto after the dragging event has concluded.

demos

https://cdn.cpmodules.webanizr.com/demo/dragAndDrop/index.html

changelog

  • September 30, 2019: 1.1.1 - fixed some typescript errors