API Docs for: v0.8.0
Show:

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']
)
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.

  • [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:

Object:

Returns el.

Item Index