Skip to content

Files

Latest commit

Sep 22, 2023
b3e34bc · Sep 22, 2023

History

History

MouseSensor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 22, 2023
Sep 22, 2023
Dec 29, 2020
Oct 6, 2017

Mouse Sensor

Draggable uses this sensor by default

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

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

API

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

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

mouseSensor.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.