iframe自适应高度
2013-04-07 10:45
253 查看
无废话,网上很多文章一下写了几种实现方式,代码短点的呢用不了,长点的呢眼睛都看花
下面的代码在火狐、IE上正常
转载自http://www.jb51.net/article/26132.htm,Mark
下面的代码在火狐、IE上正常
<script type="text/javascript"> function reinitIframe(){ var iframe = document.getElementById("mainFrame"); try{ var bHeight = iframe.contentWindow.document.body.scrollHeight; var dHeight = iframe.contentWindow.document.documentElement.scrollHeight; var height = Math.max(bHeight, dHeight); iframe.height = height; }catch (ex){} } window.setInterval("reinitIframe()", 200); </script>
转载自http://www.jb51.net/article/26132.htm,Mark
相关文章推荐
- iframe高度自适应
- 同域及跨域下iframe高度自适应(兼容IE/FF/OP/Chrome)
- 可编辑iframe高度自适应(编辑器所见即所得模式) ----- JQUERY特效模板
- jquery里iframe自适应高度
- 再谈iframe自适应高度
- 总结iframe高度自适应,自适应子页面高度
- [javascript] iframe高度调整(随时自适应)(iframe加载ajax的chart图)
- iframe自适应高度计算,iframe自适应
- 跨域iframe高度自适应(兼容IE/FF/OP/Chrome)
- jquery 实现iframe 自适应高度
- iframe 自适应高度
- Html-Css-iframe的自适应高度方案
- jQuery实现iframe的自适应高度
- 设置HTML中的Iframe框架自适应高度
- iframe加载后自适应高度
- iframe高度100%,自适应高度
- dh: 实现iframe 自适应高度的问题(初始化和动态加载数据的时候)
- JS实现iframe自适应高度
- 基于jquery的兼容各种浏览器的iframe自适应高度的脚本
- iframe自适应高度