Draggable

Moveable. Draggable

Methods

request(eopt, e.xopt, e.yopt, e.deltaXopt, e.deltaYopt, e.isInstantopt) → {Moveable.Requester}

Source:
Name Type Description
e? object the draggable's request parameter
Properties
Name Type Description
x? number x position
y? number y position
deltaX? number X number to move
deltaY? number Y number to move
isInstant? number Whether to execute the request instantly
Example
// Instantly Request (requestStart - request - requestEnd)
// Use Relative Value
moveable.request("draggable", { deltaX: 10, deltaY: 10, isInstant: true });
// Use Absolute Value
moveable.request("draggable", { x: 200, y: 100, isInstant: true });

// requestStart
const requester = moveable.request("draggable");

// request
// Use Relative Value
requester.request({ deltaX: 10, deltaY: 10 });
requester.request({ deltaX: 10, deltaY: 10 });
requester.request({ deltaX: 10, deltaY: 10 });
// Use Absolute Value
moveable.request("draggable", { x: 200, y: 100, isInstant: true });
moveable.request("draggable", { x: 220, y: 100, isInstant: true });
moveable.request("draggable", { x: 240, y: 100, isInstant: true });

// requestEnd
requester.requestEnd();
Returns:
Moveable Requester
Type
Moveable.Requester