Skip to content

Rotate

Allows you to rotate an element.

new rotate(rotateOptions)
const circle = new rotate({ element: '.circle1' });

Type:

type element = string

The element selector.

Type:

type snapAngle = number

default: 1

The angle that the rotation snaps to.

Type:

type onRotation = (angle) => {}

Executes when the element rotates.

You are able to rotate elements using actions. Since every rotate action is unique you can do the following:

const element = new rotate({ element: '.circle1' });
actions.execute(element.actionName, angle);