Show:

Q sortable Class

This jQuery plugin adds a behavior to a container that allows the user to sort its children via drag-and-drop in various environments.

Constructor

Q sortable

(
  • [options]
)

Parameters:

  • [options] Object optional

    options object which conatins parameters for function

    • [draggable='*'] String optional

      Selector for elements that can be dragged

    • [droppable='*'] String optional

      Selector for elements that can act as drop targets

    • [zIndex=999999] Number optional

      CSS z-index for sortable elements

    • [draggedOpacity=0.8] Number optional

      Element Drag effect opacity

    • [placeholderOpacity=0.1] Number optional

      Opacity for elements placeholder

    • [lift] Object optional

      parameters object for vertical movement

      • [delay=300] Number optional
        movement delay in milliseconds
      • [delayTouchscreen=300] Number optional
        movement delay for touchscreens in milliseconds
      • [threshhold=10] Number optional
        Start moving elemnt after threshhold pixels mouse (touch) dragging
      • [zoom=1.1] Number optional
        Zoom element on dragging
      • [animate=100] Number optional
        Animation speed in milliseconds
    • [scroll] Object optional

      parameters object for horisontal movement and scroll dragging

      • [delay=300] Number optional
        movement delay in milliseconds
      • [delayTouchscreen=300] Number optional
        movement delay for touchscreens in milliseconds
      • [threshhold=10] Number optional
        Start moving elemnt after threshhold pixels mouse (touch) dragging
      • [distance=1.5] Number optional
        Scrolling distance
      • [distanceWindow=0.1] Number optional
        distance to block corner
      • [speed=30] Number optional
        Element horizontal movement , scrolling speed
      • [acceleration=0.1] Number optional
        Movement Step value
    • [drop] Object optional

      object for dropping effect options

      • [duration] Number optional
        Duration of dropping effect
    • [onLift] Q.Event optional

      This triggers when an item was lifted up for dragging

    • [onIndicate] Q.Event optional

      This triggers whenever a drop result is indicated

    • [beforeDrop] Q.Event optional

      This triggers right before a drop

    • [onDrop] Q.Event optional

      This triggers after a drop. You can override the default handler the tool attaches.

    • [requireDropTarget] Boolean optional

      Whether to prevent dropping on something that is not a drop target (not in options.droppable)

    • [onSuccess] Q.Event optional

      This event triggers after a successful drag and drop

Item Index

Methods

Methods

invalidate

(
  • errors
)

Display errors on some fields

Parameters:

  • errors Object

    contains {fieldName: errorHTML} pairs

reset

(
  • elements
)

Reset all the fields, clearing any errors

Parameters:

  • elements HTMLElement | Array | JQuery

    Any elements for which to clear errors. Defaults to all elements for which the validator added errors.