xxxxxxxxxx
new ResizeObserver((entries) => {
// Check to see if the wrapperElement is exists
if (entries.length === 0 || entries[0].target !== wrapperElement) {
return;
}
// Get the wrapperElement inof
const newRect = entries[0].contentRect;
/* your logic */
/* for example
newRect.height + newRect.width */
}).observe(wrapperElement);