Created
September 17, 2012 11:51
-
-
Save redecs/3736890 to your computer and use it in GitHub Desktop.
jQuery auto-height for frame - works even if the js is in the footer
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 characters
$('frame.auto-height').on('load', function(e) { | |
this.style.height = (parseInt(this.contentWindow.document.body.offsetHeight) + 100) + 'px'; | |
}).each(function() { | |
this.style.height = (parseInt(this.contentWindow.document.body.offsetHeight) + 100) + 'px'; | |
return false; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment