Skip to content

Instantly share code, notes, and snippets.

@antz29
Created July 27, 2010 11:45
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 antz29/492113 to your computer and use it in GitHub Desktop.
Save antz29/492113 to your computer and use it in GitHub Desktop.
Setting the height of an IFRAME onload.
<body>
<h1>Loading...</h1>
<h1>Loading...</h1>
<h1>Loading...</h1>
<h1>Loading...</h1>
<h1>Loading...</h1>
<h1>Loading...</h1>
<h1>Loading...</h1>
<h1>Loading...</h1>
<h1>Loading...</h1>
<h1>Loading...</h1>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function() {
$(parent.document).find('#container').height($(document).height() + 10);
});
</script>
</body>
<iframe id="container" src="frame.htm" width="800" height="50" scrolling="no" frameborder="1"></iframe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment