Last active
December 17, 2015 21:10
-
-
Save vitkon/5673222 to your computer and use it in GitHub Desktop.
JS: Resize iFrame to its content
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
$("#modalIFrame").bind('load', | |
function () { | |
var newheight, | |
newwidth; | |
newheight = this.contentWindow.document.body.scrollHeight; | |
newwidth = this.contentWindow.document.body.scrollWidth; | |
$(this).height(newheight); | |
$(this).width(newwidth); | |
} | |
); | |
$("#modalIFrame").attr('src', url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment