iframe resizer use internal body, plus margin
[kengrimes.com/theme.git] / static / js / main.js
index 8c3d452..13c4dae 100644 (file)
@@ -20,3 +20,7 @@ window.onload = () => {
   })
   updateNav()
 }
+const resizeIFrame = (iframe) => {
+  iframe.style.height = 0
+  iframe.style.height = (iframe.contentWindow.document.body.scrollHeight * 1.2) + 'px';
+}