ResizeMonitor
Allows size monitoring of elements (or optionally a Window instance).
ResizeMonitor.addResizeListener(
myElement,
element => {
console.log(element, ' changed size');
}
);
Functions
2
Functions
2addResizeListenerstatic
Adds a resize listener to the passed element which is called when the element is resized by layout.
| Parameter | Type | Description |
|---|---|---|
element | HTMLElement | Document | The element to listen for resizing. |
handler | ResizeMonitorEventCallback | The handling function. Will be passed the element. |
immediate | Boolean | Pass |
removeResizeListenerstatic
Removes a resize listener from the passed element.
| Parameter | Type | Description |
|---|---|---|
element | HTMLElement | Document | The element to listen for resizing. |
handler | function | The handling function to remove. |
Typedefs
1
Typedefs
1ResizeMonitorEventCallback: function
Resize event handing callback
| Parameter | Type | Description |
|---|---|---|
element | HTMLElement | Resized element |
oldRect | DOMRectReadOnly | Old size rectangle |
newRect | DOMRectReadOnly | New size rectangle |