Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 965 Bytes

File metadata and controls

35 lines (23 loc) · 965 Bytes

Touch Sensor

Draggable uses this sensor by default

Picks up browser touch events and triggers the events below on a source container.

  • drag:start
  • drag:move
  • drag:stop

API

new TouchSensor(containers: HTMLElement[]|NodeList|HTMLElement, options: Object): TouchSensor
To create a touch sensor, specify the containers it should pay attention to. Sensors will always trigger sensor events on container element.

touchSensor.attach(): void
Attaches sensors to the DOM

touchSensor.detach(): void
Detaches sensors to the DOM

Options

draggable {String}
A css selector for draggable elements within the containers specified.

delay {Number}
This value will delay touch start.

distance {Number}
The distance you want the pointer to have moved before drag starts.

handle {String}
Specify a css selector for a handle element if you don't want to allow drag action on the entire element.