, ,, , ,, , , , image/svg+xml , image/svg+xml , interact.js , image/svg+xml , ,, , ,
NAV

Global

Methods

interact(target) → {Interactable}

interact('#draggable').draggable(true)

var rectables = interact('rect')
rectables
  .gesturable(true)
  .on('gesturemove', function (event) {
      // ...
  })

The methods of this variable can be used to set elements as interactables and also to change various default settings.

Calling it as a function and passing an element or a valid CSS selector string returns an Interactable object which has various methods to configure it.

Parameters:
NameTypeDescription
targetElement | string

The HTML or SVG Element to interact with or CSS selector

Returns:
Type:
Interactable

preventDefault()

Prevent the default behaviour of the original Event