Draggable Class
Basic drag implementation for DOM elements inside a container. Provide start/stop/drag callbacks.
Constructor
Draggable
-
el -
[options] -
[options.ignore_dragging] Array of node names that sould not trigger dragging, by default is `['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON']
Parameters:
-
elHTMLElementThe HTMLelement that contains all the widgets to be dragged.
-
[options]Object optionalAn Object with all options you want to overwrite:
-
[items]HTMLElement | String optionalDefine who will be the draggable items. Can be a CSS Selector String or a collection of HTMLElements.
-
[distance]Number optionalDistance in pixels after mousedown the mouse must move before dragging should start.
-
[limit]Boolean optionalConstrains dragging to the width of the container
-
[offset_left]Offset_left optionalOffset added to the item that is being dragged.
-
[drag]Number optionalExecutes a callback when the mouse is moved during the dragging.
-
[start]Number optionalExecutes a callback when the drag starts.
-
[stop]Number optionalExecutes a callback when the drag stops.
-
-
[options.ignore_dragging] Array of node names that sould not trigger dragging, by default is `['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON']Object | Function`. If a function is used return true to ignore dragging.
Returns:
Returns el.