<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Colin Godsey &#187; javascript</title>
	<atom:link href="http://www.colingodsey.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.colingodsey.com</link>
	<description>CRG Studios &#38; Consulting</description>
	<lastBuildDate>Sat, 06 Mar 2010 00:09:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dynamic Iframe Sized to Contents w/ Javascript</title>
		<link>http://www.colingodsey.com/dynamic-iframe-sized-to-contents-w-javascript/</link>
		<comments>http://www.colingodsey.com/dynamic-iframe-sized-to-contents-w-javascript/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 16:28:44 +0000</pubDate>
		<dc:creator>Colin Godsey</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.colingodsey.com/dynamic-iframe-sized-to-contents-w-javascript/</guid>
		<description><![CDATA[This Javascript works with Firefox and IE7. The function is called by the iframe&#8217;s onLoad event. It pulls the scrollbar height from the frame and resizes the frame height to match it.
&#60;script language=&#8221;text/javascript&#8221;&#62;
&#60;!&#8211;
function calcHeight()
{
var the_height=
document.getElementById(&#8217;submit_frame&#8217;).contentWindow.
document.body.scrollHeight;
document.getElementById(&#8217;submit_frame&#8217;).style.height=
(the_height+10)+&#8221;px&#8221;;
}
//&#8211;&#62;
&#60;/script&#62;
And use the following HTML for the iframe.
&#60;iframe src=&#8221;frame.html&#8221; onLoad=&#8221;calcHeight();&#8221; scrolling=&#8221;no&#8221; id=&#8221;submit_frame&#8221; style=&#8221;width: 400px&#8221;&#62;&#60;/iframe&#62;
]]></description>
			<content:encoded><![CDATA[<p>This Javascript works with Firefox and IE7. The function is called by the iframe&#8217;s <em>onLoad</em> event. It pulls the scrollbar height from the frame and resizes the frame height to match it.</p>
<blockquote><p>&lt;script language=&#8221;text/javascript&#8221;&gt;<br />
&lt;!&#8211;<br />
function calcHeight()<br />
{<br />
var the_height=<br />
document.getElementById(&#8217;submit_frame&#8217;).contentWindow.<br />
document.body.scrollHeight;</p>
<p>document.getElementById(&#8217;submit_frame&#8217;).style.height=<br />
(the_height+10)+&#8221;px&#8221;;<br />
}<br />
//&#8211;&gt;<br />
&lt;/script&gt;</p></blockquote>
<p>And use the following HTML for the iframe.</p>
<blockquote><p>&lt;iframe src=&#8221;frame.html&#8221; onLoad=&#8221;calcHeight();&#8221; scrolling=&#8221;no&#8221; id=&#8221;submit_frame&#8221; style=&#8221;width: 400px&#8221;&gt;&lt;/iframe&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.colingodsey.com/dynamic-iframe-sized-to-contents-w-javascript/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
