An event or observer for changes to getBoundingClientRect()
As mentioned in the comments above. The APIs you’re looking for are: ResizeObserver and IntersectionObserver. However, there are a few things to note: ResizeObserver will only fire when the observed element changes size. And it will essentially only give you correct values for width and height. Both ResizeObserver and IntersectionObserver are supposed to not block … Read more