Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walterdavis/ddee3ae7de3a8c6f935a to your computer and use it in GitHub Desktop.
Save walterdavis/ddee3ae7de3a8c6f935a to your computer and use it in GitHub Desktop.
Paste this into the head of a Freeway page to call out from that page to an iframe enclosing it, to adjust that iframe to fit the height of the current page.
<script type="text/javascript">
window.addEventListener('load', function(evt){
var box = document.getElementById('PageDiv'), h;
if (box.hasOwnProperty(outerHeight)){ // old IE
h = box.outerHeight;
}else{
var style = document.defaultView.getComputedStyle(box, '');
h = style.getPropertyValue("height");
}
if(top.resize_iframe) top.resize_iframe( parseInt(h, 10) );
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment