Last active
November 5, 2018 14:42
-
-
Save keslo/efdc0b7154c9e2762c37b0338bb22441 to your computer and use it in GitHub Desktop.
Change the height of iframe after it had loaded
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
// change the height of iframe after it had loaded | |
var timerId = setTimeout(function tick() { | |
var frame = document.getElementsByTagName('iframe')[0]; | |
(frame) ? | |
// get height of body in frame and change style frame | |
frame.style.height = this.document.body.offsetHeight+ 'px' : | |
timerId = setTimeout(tick, 500) | |
}, 500) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment