-
-
Save jhit/eab6286c8236425341710fea382bca7d to your computer and use it in GitHub Desktop.
Revisions
-
LukeFF created this gist
Sep 7, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ <body onLoad="resizeParent();"> <script type="text/javascript"> function resizeParent() { var height = document.getElementsByTagName("html")[0].scrollHeight; window.parent.postMessage(["setIframeHeight", height], "*"); } </script> </body> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ <iframe id="superiFrame" src="..." style="width: 100%; border: none;" scrolling="no" height="500"></iframe> <script type="text/javascript"> window.addEventListener('message', function(e) { var iframe = document.getElementById('superFrame'); var eventName = e.data[0]; var height = e.data[1]; switch(eventName) { case 'setIframeHeight': iframe.height = height; break; } }, false); </script>