Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!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
You can’t perform that action at this time.