<?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>人生若只如初見 &#187; iframe自适应</title>
	<atom:link href="http://www.78wd.com/tag/iframe%e8%87%aa%e9%80%82%e5%ba%94/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.78wd.com</link>
	<description>i PanGel,and U</description>
	<lastBuildDate>Tue, 07 Feb 2012 07:26:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>iframe自适应大小代码</title>
		<link>http://www.78wd.com/iframe-auto/</link>
		<comments>http://www.78wd.com/iframe-auto/#comments</comments>
		<pubDate>Mon, 10 May 2010 09:35:28 +0000</pubDate>
		<dc:creator>pangel</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[iframe自适应]]></category>

		<guid isPermaLink="false">http://www.78wd.com/?p=576</guid>
		<description><![CDATA[主要是自适应高度，兼容ie及Firefox，主要为了便于灵活管理用于页面调用未知高度的广告页面。 js代码 &#60;script type=&#34;text/javascript&#34;&#62; //用逗号把每个iframe的ID分隔. 例如: [&#34;myframe1&#34;, &#34;myframe2&#34;]，可以只有一个窗体，则不用逗号。 //定义iframe的ID var iframeids=[&#34;test&#34;] //如果用户的浏览器不支持iframe是否将iframe隐藏 yes 表示隐藏，no表示不隐藏 var iframehide=&#34;yes&#34; function dyniframesize() { var dyniframe=new Array() for (i=0; i&#60;iframeids.length; i++) { if (document.getElementById) { //自动调整iframe高度 dyniframe[dyniframe.length] = document.getElementById(iframeids[i]); if (dyniframe[i] &#38;&#38;!window.opera) { dyniframe[i].style.display=&#34;block&#34; if &#8230; <a href="http://www.78wd.com/iframe-auto/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>主要是自适应高度，兼容ie及Firefox，主要为了便于灵活管理用于页面调用未知高度的广告页面。<br />
js代码</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
//用逗号把每个iframe的ID分隔. 例如: [&quot;myframe1&quot;, &quot;myframe2&quot;]，可以只有一个窗体，则不用逗号。
//定义iframe的ID
var iframeids=[&quot;test&quot;]
//如果用户的浏览器不支持iframe是否将iframe隐藏 yes 表示隐藏，no表示不隐藏
var iframehide=&quot;yes&quot;
function dyniframesize()
{
var dyniframe=new Array()
for (i=0; i&lt;iframeids.length; i++)
{
if (document.getElementById)
{
//自动调整iframe高度
dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
if (dyniframe[i] &amp;&amp;!window.opera)
{
dyniframe[i].style.display=&quot;block&quot;
if (dyniframe[i].contentDocument &amp;&amp;dyniframe[i].contentDocument.body.offsetHeight) //如果用户的浏览器是NetScape
dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight;
else if (dyniframe[i].Document &amp;&amp;dyniframe[i].Document.body.scrollHeight) //如果用户的浏览器是IE
dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
}
}
//根据设定的参数来处理不支持iframe的浏览器的显示问题
if ((document.all || document.getElementById) &amp;&amp;iframehide==&quot;no&quot;)
{
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display=&quot;block&quot;
}
}
}
if (window.addEventListener)
window.addEventListener(&quot;load&quot;, dyniframesize, false)
else if (window.attachEvent)
window.attachEvent(&quot;onload&quot;, dyniframesize)
else
window.onload=dyniframesize
&lt;/script&gt;
</pre>
<p>html代码</p>
<pre class="brush: xml;">
&lt;iframe src =&quot;xxx.htm&quot;  frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot;  frameborder=&quot;0&quot; scrolling=&quot;no&quot; id=&quot;test&quot; name=&quot;test&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.78wd.com/iframe-auto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: www.78wd.com @ 2012-02-11 13:05:29 -->
