Last active
September 16, 2015 20:52
-
-
Save codfish/cd05a8a851c28fcb0500 to your computer and use it in GitHub Desktop.
Update the height of an iframe dynamically based on the height of the source content. Code is dependent on jQuery, and will only work when iframe is the same host/domain as the parent page, or if you have access to the content of the iframe. Reference: http://goo.gl/Rz3Ryz
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
| // @example | |
| // <iframe src="/form.html" id="infographic-iframe"></iframe> | |
| document.getElementById('infographic-iframe').style.height = $('#infographic-iframe').contents().height() + 'px'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment