Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)
Members
pinchable
Whether or not target can be pinched with draggable, resizable, scalable, rotatable (default: false)
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body);
moveable.pinchable = true;
Type Definitions
OnPinch
Properties:
currentTarget:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
moveable:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
clientX:
number
The horizontal coordinate within the application's client area at which the event occurred.
clientY:
number
The vertical coordinate within the application's client area at which the event occurred.
Type:
- TSInterface
OnPinchEnd
Properties:
currentTarget:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
moveable:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
clientX:
number
The horizontal coordinate within the application's client area at which the event occurred.
clientY:
number
The vertical coordinate within the application's client area at which the event occurred.
Type:
- TSInterface
OnPinchGroup
Properties:
Type:
- TSInterface
OnPinchGroupEnd
Properties:
Type:
- TSInterface
OnPinchGroupStart
Properties:
Type:
- TSInterface
OnPinchStart
Properties:
currentTarget:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
moveable:
MoveableManagerInterface<Record<string, any>, Record<string, any>>
The Moveable instance
clientX:
number
The horizontal coordinate within the application's client area at which the event occurred.
clientY:
number
The vertical coordinate within the application's client area at which the event occurred.
Type:
- TSInterface
PinchableOptions
Properties:
pinchable
optional
Default Value: false
pinchable?:
boolean | Array<"rotatable" | "resizable" | "scalable">
Whether or not target can be pinched with draggable, resizable, scalable, rotatable.
Type:
- TSInterface
Events
pinch
When pinching, the pinch event is called with part of scale, rotate, resize
Type | Description |
---|---|
Moveable.Pinchable.OnPinch | Parameters for the pinch event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
rotatable: true,
scalable: true,
pinchable: true, // ["rotatable", "scalable"]
});
moveable.on("pinch", ({ target }) => {
console.log(target);
});
moveable.on("rotate", ({ target }) => {
console.log(target);
});
moveable.on("scale", ({ target }) => {
console.log(target);
});
pinchEnd
When the pinch finishes, the pinchEnd event is called.
Type | Description |
---|---|
Moveable.Pinchable.OnPinchEnd | Parameters for the pinchEnd event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
rotatable: true,
scalable: true,
pinchable: true, // ["rotatable", "scalable"]
});
moveable.on("pinchEnd", ({ target }) => {
console.log(target);
});
moveable.on("rotateEnd", ({ target }) => {
console.log(target);
});
moveable.on("scaleEnd", ({ target }) => {
console.log(target);
});
pinchGroup
When the group pinch, the `pinchGroup` event is called.
Type | Description |
---|---|
Moveable.Pinchable.OnPinchGroup | Parameters for the `pinchGroup` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
target: [].slice.call(document.querySelectorAll(".target")),
pinchable: true
});
moveable.on("pinchGroup", ({ targets, events }) => {
console.log("onPinchGroup", targets);
});
pinchGroupEnd
When the group pinch finishes, the `pinchGroupEnd` event is called.
Type | Description |
---|---|
Moveable.Pinchable.OnPinchGroupEnd | Parameters for the `pinchGroupEnd` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
target: [].slice.call(document.querySelectorAll(".target")),
pinchable: true
});
moveable.on("pinchGroupEnd", ({ targets, isDrag }) => {
console.log("onPinchGroupEnd", targets, isDrag);
});
pinchGroupStart
When the group pinch starts, the `pinchGroupStart` event is called.
Type | Description |
---|---|
Moveable.Pinchable.OnPinchGroupStart | Parameters for the `pinchGroupStart` event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
target: [].slice.call(document.querySelectorAll(".target")),
pinchable: true
});
moveable.on("pinchGroupStart", ({ targets }) => {
console.log("onPinchGroupStart", targets);
});
pinchStart
When the pinch starts, the pinchStart event is called with part of scaleStart, rotateStart, resizeStart
Type | Description |
---|---|
Moveable.Pinchable.OnPinchStart | Parameters for the pinchStart event |
Example
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
rotatable: true,
scalable: true,
pinchable: true, // ["rotatable", "scalable"]
});
moveable.on("pinchStart", ({ target }) => {
console.log(target);
});
moveable.on("rotateStart", ({ target }) => {
console.log(target);
});
moveable.on("scaleStart", ({ target }) => {
console.log(target);
});