Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div style="border:2px solid #666; border-radius:11px; padding:20px;">
- <iframe id="form-iframe" src="iframe1form.html" style="margin:0; width:100%; height:150px; border:none; overflow:hidden;" scrolling="no" onload="AdjustIframeHeightOnLoad()"></iframe>
- <script type="text/javascript">
- function AdjustIframeHeightOnLoad() { document.getElementById("form-iframe").style.height = document.getElementById("form-iframe").contentWindow.document.body.scrollHeight + "px"; }
- function AdjustIframeHeight(i) { document.getElementById("form-iframe").style.height = parseInt(i) + "px"; }
- </script>
- </div>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
- <title>iFrame Resizing Test</title>
- </head>
- <body style="margin-top:0; text-align:center;">
- <h1 style="margin-top:0;">
- iFrame Resizing Test
- </h1>
- <p>
- When the form button is clicked, the thank-you page loads.
- </p>
- <form method="post" action="iframe1th.html">
- <input type="submit" value="Click">
- </form>
- </body>
- </html>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
- <title>iFrame Test Thank-you Page</title>
- </head>
- <body style="margin-top:0;">
- <div id="page-container">
- <h1 style="margin-top:0; text-align:center; letter-spacing:1px;">
- Thank You!
- </h1>
- </div>
- <script type="text/javascript">
- parent.AdjustIframeHeight(document.getElementById("page-container").scrollHeight);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement