Adjust iFrame Height
Post # 171 permalink Topic #171 by mreschke on 2010-01-07 11:30:55 (viewed 457 times)

http://blogs.x2line.com/al/articles/315.aspx

Instead of onclick, I am going to add a function AdjustHeight to the onload of the body of the child frame
And add this function the the iframe aspx page. Doesn't work for me yet because my iframe is nested in a DetailRow
So I have to find the correct name for the iframe.

JAVASCRIPT Code Snippet
   function AdjustHeight() {
        parent.document.getElementById('ifrForms').style.height = document.body.scrollHeight + 5;
    }
 

Javascript Tip: Adjust iframe Size to Fit its Contents
Sometimes we put iframe on HTML page and we need to adjust iframe size to fit its contents (iframe source HTML can be very big) ... Below is a small example that demonstrates how to do it:

JAVASCRIPT Code Snippet
< iframe id="ifr" src="ifr.html">< /iframe>< br />
< input type="button" onclick="document.getElementById('ifr').style.height =
ifr.document.body.scrollHeight + 5" value="Ajust" />
 

Fixme Add new resize iframe and textarea from mrcore4 project