Last active
November 8, 2016 18:03
-
-
Save pveyes/ef527bf0240100115ce7b1e00bc01e64 to your computer and use it in GitHub Desktop.
This file contains 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
document.querySelectorAll('iframe').forEach(ifr => { | |
// use onload property because we need to get the height | |
// after all content is fully loaded | |
ifr.onload = function () { | |
ifr.style.height = ifr.contentWindow.document.body.scrollHeight + 'px'; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment