メインコンテンツまでスキップ

Function: createDrag()

function createDrag(element, options?): DragInstance;

Defined in: dom/src/pointer/drag.ts:175

Track a pointer drag on an element.

Uses Pointer Events only, and pointer capture so that the drag keeps working once the pointer leaves the element. For the lifetime of the instance the element gets touch-action: none so that touch dragging does not scroll the page, plus user-select: none so that a long press does not start a text selection instead.

One pointer at a time by default; see DragOptions.multiPointer.

Parameters​

ParameterType
elementElement
optionsDragOptions

Returns​

DragInstance