API Docs for:
Show:

Draggable Class

Basic drag implementation for DOM elements inside a container. Provide start/stop/drag callbacks.

Constructor

Draggable

(
  • el
  • [options]
)
Object

Parameters:

  • el HTMLElement

    The HTMLelement that contains all the widgets to be dragged.

  • [options] Object optional

    An Object with all options you want to overwrite:

    • [items] HTMLElement | String optional

      Define who will be the draggable items. Can be a CSS Selector String or a collection of HTMLElements.

    • [distance] Number optional

      Distance in pixels after mousedown the mouse must move before dragging should start.

    • [limit] Boolean optional

      Constrains dragging to the width of the container

    • [offset_left] Offset_left optional

      Offset added to the item that is being dragged.

    • [drag] Number optional

      Executes a callback when the mouse is moved during the dragging.

    • [start] Number optional

      Executes a callback when the drag starts.

    • [stop] Number optional

      Executes a callback when the drag stops.

Returns:

Object: Returns el.

Item Index