Skip to main content

Home > @jsplumbtoolkit/browser-ui > Surface > setPan

Surface.setPan() method

Sets the position of the panned content's origin.

Signature:

setPan(left: number, top: number, animate?: boolean, onComplete?: (p: PointXY) => any): void;

Parameters

ParameterTypeDescription
leftnumberPosition in pixels of the left edge of the panned content.
topnumberPosition in pixels of the top edge of the panned content.
animatebooleanWhether or not to animate the pan. Defaults to false.
onComplete(p: PointXY) => anyIf animate is set to true, an optional callback for the end of the pan

Returns:

void