We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 567e155 commit 2b87e19Copy full SHA for 2b87e19
resize-observer/resize-observer-text.html
@@ -64,7 +64,7 @@ <h1>So what happened?</h1>
64
</form>
65
</div>
66
<script>
67
- if(ResizeObserver) {
+ if(window.ResizeObserver) {
68
const h1Elem = document.querySelector('h1');
69
const pElem = document.querySelector('p');
70
const divElem = document.querySelector('body > div');
@@ -87,6 +87,7 @@ <h1>So what happened?</h1>
87
pElem.style.fontSize = Math.max(1, entry.contentRect.width/600) + 'rem';
88
}
89
90
+ console.log('Size changed');
91
});
92
93
resizeObserver.observe(divElem);
@@ -98,6 +99,8 @@ <h1>So what happened?</h1>
98
99
resizeObserver.unobserve(divElem);
100
101
102
+ } else {
103
+ console.log('Resize observer not supported!');
104
105
</script>
106
</body>
0 commit comments