Observes element size changes using a hidden iframe
by developitJavaScript
Last 12 weeks · 0 commits
1 of 6 standards met
I understand that at this point, this project seems to be no longer maintained. But I just want to point out, the code seems only work in Chrome (8/2019), which makes it a bit pointless because Chrome natively supports ResizeObserver. Firefox 68 and Edge (the non-chromium one) currently doesn't support ResizeObserver and this workaround also doesn't work with the two browsers. Here is my code in case I used in incorrectly:
The solution of and does not keep the iframe positioned in a viewable area at all times. If the target element is nested in an element with and the target element has a negative top margin or a negative absolute positioned top the resize events stop working. seems to fix the issue but I'm not sure what all the consequences are.
Repository: developit/simple-element-resize-detector. Description: Observes element size changes using a hidden iframe Stars: 189, Forks: 4. Primary language: JavaScript. Languages: JavaScript (100%). Topics: dom, dom-mutation-observers, dom-utilities, element-resizes, observes-resizing. Latest release: 1.3.0 (7y ago). Open PRs: 0, open issues: 3. Last activity: 7y ago. Community health: 28%. Top contributors: developit, NekR, bfred-it.