Skip to content

Instantly share code, notes, and snippets.

@pashute
Last active February 19, 2018 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pashute/c4705ce7f767f50fdf56d0030ecf9192 to your computer and use it in GitHub Desktop.
Save pashute/c4705ce7f767f50fdf56d0030ecf9192 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("iframe").load( function () {
var c = (this.contentWindow || this.contentDocument);
if (c.document) d = c.document;
var ih = $(d).outerHeight();
var iw = $(d).outerWidth();
$(this).css({
height: ih,
width: iw
});
});
});
</script>
<style>
iframe {border:0; overflow:hidden;}
</style>
</head>
<body>
<h1>
Testing iframe resizer
</h1>
<h4>Checking <a href="https://stackoverflow.com/a/20777751/141947">ddlab's answer</a> for resizing cross platform iframe without access to the external server </h4>
removing style width doesn't help either. Error returned in script.<br />
<iframe src="https://www.ibm.com/us-en/" style="width:700px; height:500px">
</iframe>
<footer>Thank you for watching and stay tuned to middle C with Pashute
<br />Note: Removing the footer doesn't help</footer>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment