Dragger

Dragger

You can set up drag events in any browser.

Constructor

new Dragger(targets, optionsopt)

Source:
Name Type Default Description
targets Array<Element | Window> | Element | Window
options? DragOptions {}

Methods

isDragging()

Source:

isFlag()

Source:

isPinchFlag()

Source:

isPinching()

Source:

onDragStart()

Source:

scrollBy(deltaX, deltaY, e, isCallDragopt)

Source:
Name Type Default Description
deltaX number
deltaY number
e any
isCallDrag? boolean true

unset()

Source:

Type Definitions

Client

Source:
Properties:
Name Type Description
clientX number
clientY number
Type:
  • TSInterface

Delta

Source:
Properties:
Name Type Description
deltaX number
deltaY number
Type:
  • TSInterface

Dist

Source:
Properties:
Name Type Description
distX number
distY number
Type:
  • TSInterface

DragOptions

Source:
Properties:
Name Type Description
container? Window | Node | Element
events? Array<"mouse" | "touch">
preventRightClick? boolean
preventDefault? boolean
pinchThreshold? number
pinchOutside? boolean
checkInput? boolean
dragstart? (options: OnDragStart) => any
drag? (options: OnDrag) => any
dragend? (options: OnDragEnd) => any
pinchstart? (options: OnPinchStart) => any
pinch? (options: OnPinch) => any
pinchend? (options: OnPinchEnd) => any
Type:
  • TSInterface

Event

Source:
Properties:
Name Type Description
type string
Type:
  • TSInterface

OnDrag

Source:
Properties:
Name Type Description
type string
deltaX number
deltaY number
distX number
distY number
clientX number
clientY number
isDrag boolean
isPinch boolean
movement number
datas IObject<any>
isScroll boolean
inputEvent any
Type:
  • TSInterface

OnDragEnd

Source:
Properties:
Name Type Description
type string
deltaX number
deltaY number
distX number
distY number
clientX number
clientY number
isDrag boolean
isDouble boolean
datas IObject<any>
inputEvent any
Type:
  • TSInterface

OnDragStart

Source:
Properties:
Name Type Description
type string
deltaX number
deltaY number
distX number
distY number
clientX number
clientY number
datas IObject<any>
inputEvent any
isTrusted any
Type:
  • TSInterface

OnPinch

Source:
Properties:
Name Type Description
type string
deltaX number
deltaY number
distX number
distY number
clientX number
clientY number
datas IObject<any>
touches Position[]
rotation number
angle number
scale number
distance number
movement number
inputEvent any
Type:
  • TSInterface

OnPinchEnd

Source:
Properties:
Name Type Description
type string
deltaX number
deltaY number
distX number
distY number
clientX number
clientY number
isPinch boolean
datas IObject<any>
touches Position[]
inputEvent any
Type:
  • TSInterface

OnPinchStart

Source:
Properties:
Name Type Description
type string
deltaX number
deltaY number
distX number
distY number
clientX number
clientY number
datas IObject<any>
touches Position[]
angle number
inputEvent any
Type:
  • TSInterface

Position

Source:
Properties:
Name Type Description
deltaX number
deltaY number
distX number
distY number
clientX number
clientY number
Type:
  • TSInterface