如何让Iframe自适应高度_ie_firefox下都可用

从网上找的,不是自已写的! 放出来给自已留个备份!
从这里找的!http://www.zishu.cn/

<script type="text/javascript"><br/> function SetCwinHeight(){<br/>  var xunzou=document.getElementById("xunzou"); //iframe id<br/>  if (document.getElementById){<br/>   if (xunzou && !window.opera){<br/>    if (xunzou.contentDocument && xunzou.contentDocument.body.offsetHeight){<br/>     xunzou.height = xunzou.contentDocument.body.offsetHeight;<br/>    }else if(xunzou.Document && xunzou.Document.body.scrollHeight){<br/>     xunzou.height = xunzou.Document.body.scrollHeight;<br/>    }<br/>   }<br/>  }<br/> }<br/></script><br/><iframe width="100%" id="xunzou" onload="Javascript:SetCwinHeight()" height="1" frameborder="0" src="/index.html"></iframe>

0 条留言

我要留言
(必填)
(必填,绝不公开)