Skip to content

Instantly share code, notes, and snippets.

@jtrezza
Created May 3, 2016 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jtrezza/fdbaa51bf2c030efd4a54a847a47e4d4 to your computer and use it in GitHub Desktop.
Save jtrezza/fdbaa51bf2c030efd4a54a847a47e4d4 to your computer and use it in GitHub Desktop.
<head>
<script type="text/javascript">
window.iFrameResizer = {
readyCallback: function(){
parentIFrame.sendMessage(documentHeight())
}
}
function documentHeight() {
return Math.max(
document.documentElement.clientHeight,
document.body.scrollHeight,
document.documentElement.scrollHeight,
document.body.offsetHeight,
document.documentElement.offsetHeight
);
}
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/3.5.3/iframeResizer.contentWindow.js"></script>
</head>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment