iframe高度自动适应宽高的js (兼容FF)
2013-01-07 09:50
561 查看
在机票版本中应用了iframe,但FF对iframe的高度解析有问题,因此调用以下JS
function SetCwinHeight(){ var xunzou=document.getElementById(“xunzou”); //iframe id if (document.getElementById){ if (xunzou && !window.opera){ if (xunzou.contentDocument && xunzou.contentDocument.body.offsetHeight){ xunzou.height = xunzou.contentDocument.body.offsetHeight; }else if(xunzou.Document && xunzou.Document.body.scrollHeight){ xunzou.height = xunzou.Document.body.scrollHeight; } } } } HTML调用 <iframe width=”100%” id=”xunzou” onload=”Javascript:SetCwinHeight()” height=”1″ frameborder=”0″ src=”地址” scrolling=”no”></iframe>
相关文章推荐
- 兼容火狐和IE的javascript中iframe自动适应高度
- JQuery自适应IFrame高度(支持嵌套 兼容IE,ff,safafi,chrome)
- iframe同域或异域下高度自动适应(兼容种浏览器)
- JQuery自适应IFrame高度(支持嵌套 兼容IE,ff,safafi,chrome)
- js 操作 Iframe (跨域,高度自动适应)
- 用JS控制IFrame的高度,让它的高度自动适应
- js实现的真正的iframe高度自适应(兼容IE,FF,Opera)
- JS怎么控制IFRAME高度自动适应内容而不出现滚动条
- js Iframe 自动适应 高度 宽度
- JQuery自适应IFrame高度(支持嵌套--兼容IE,ff,safafi,chrome)
- 用JS控制Iframe自动适应页面的高度
- js实现的非跨域的iframe高度自适应(完美兼容IE,FF,Opera)
- iframe高度自动适应
- Iframe 自动适应页面的高度示例代码
- Iframe自动适应高度
- iframe自动适应高度跨域
- 同域及跨域下iframe高度自适应(兼容IE/FF/OP/Chrome)
- js实现iframe自动自适应高度的方法
- js控制textarea输入框根据内容自动适应高度