From: ken Date: Sat, 31 Mar 2018 00:58:01 +0000 (-0700) Subject: iframe resizer use internal body X-Git-Url: https://www.kengrimes.com/gitweb/?p=kengrimes.com%2Ftheme.git;a=commitdiff_plain;h=3fc85e94aaa6f47cf20c6af1bfaf80b9bb6ead2f iframe resizer use internal body --- diff --git a/static/js/main.js b/static/js/main.js index a699357..b0ada37 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -22,5 +22,5 @@ window.onload = () => { } const resizeIFrame = (iframe) => { iframe.style.height = 0 - iframe.style.height = document.body.scrollHeight + 'px'; + iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px'; }