Resize
Allows you to resize an element.
new resize(resizeOptions);
Basic implementation
Section titled “Basic implementation”const square = new resize({ element: '.square' });
resizeOptions
Section titled “resizeOptions”element
Section titled “element”Type:
type element = string
The element selector.
edgeWidth
Section titled “edgeWidth”Type:
type edgeWidth = number
default: 5
The width of the edge that you can grab.
widthMin
Section titled “widthMin”Type:
type widthMin = number
default: 50
The minimum width that element can be resized to.
widthMax
Section titled “widthMax”Type:
type widthMax = number
default: window.innerWidth
The maximum width that element can be resized to.
heightMin
Section titled “heightMin”Type:
type heightMin = number
default: 50
The minimum height that element can be resized to.
heightMax
Section titled “heightMax”Type:
type heightMax = number
default: window.innerHeight
The maximum height that element can be resized to.
onWidthChange
Section titled “onWidthChange”Type:
type onWidthChange = (width) => {}
Executes when the element width changes
onHeightChange
Section titled “onHeightChange”Type:
type onHeightChange = (height) => {}
Executes when the element height changes.
Actions
Section titled “Actions”You are able to resize elements using actions. Since every resize action is unique you can do the following:
const element = new resize({ element: '.square' });
actions.execute(element.heightAction, height);
actions.execute(element.widthAction, width);