解决iframe框架页面自适应高度问题代码如下,需要注意的是框架引用页面一定要设置name属性,否则会不生效 方案一:<iframe src="test.asp" width="100%" frameborder="0" scrolling="no" name="hj" id="hj"></iframe>test.asp页面head间增加如下JS代码<SCRIPT LANGUAGE="JavaScript">function f_frameStyleResize(targObj){var targWin = targObj.parent.document.all[targObj.name];if(targWin != null) {var HeightValue = targObj.document.body.scrollHeightif(HeightValue < 600){HeightValue = 600}targWin.style.pixelHeight = HeightValue;}}function f_iframeResize(){bLoadComplete = true; f_frameStyleResize(self);}var bLoadComplete = false;window.onload = f_iframeResize;</SCRIPT>
Iframe框架高度自动的实现方法
未经允许不得转载:福利吧|福利社|fuliba » Iframe框架高度自动的实现方法
相关推荐
- 暂无文章