iframe实现自适应高度
2010-09-06 12:31
218 查看
<script type ="text/javascript" language ="javascript" >
<!--
function TuneHeight(fm_name,fm_id){
var frm=document.getElementById(fm_id);
var subWeb=document.frames?document.frames[fm_name].document:frm.contentDocument;
if (frm != null && subWeb != null){
frm.style.height = subWeb.documentElement.scrollHeight+ "px" ;
//如需自适应宽高,去除下行的“//”注释即可
// frm.style.width = subWeb.documentElement.scrollWidth+"px";
}
}
//-->
</script>
<iframe
onLoad ="{TuneHeight('FM_Name','FM_Id');}"
src ="http://www.3netgo.com" name ="FM_Name"
id ="FM_Id" width ="800" marginwidth ="0"
marginheight ="0"
frameborder ="0" scrolling ="no" >
</iframe>
<!--
function TuneHeight(fm_name,fm_id){
var frm=document.getElementById(fm_id);
var subWeb=document.frames?document.frames[fm_name].document:frm.contentDocument;
if (frm != null && subWeb != null){
frm.style.height = subWeb.documentElement.scrollHeight+ "px" ;
//如需自适应宽高,去除下行的“//”注释即可
// frm.style.width = subWeb.documentElement.scrollWidth+"px";
}
}
//-->
</script>
<iframe
onLoad ="{TuneHeight('FM_Name','FM_Id');}"
src ="http://www.3netgo.com" name ="FM_Name"
id ="FM_Id" width ="800" marginwidth ="0"
marginheight ="0"
frameborder ="0" scrolling ="no" >
</iframe>
相关文章推荐
- 如何实现iframe(嵌入式帧)的自适应高度
- 实现iFrame自适应高度
- 完美实现跨域Iframe高度自适应【Iframe跨域高度自适应解决方案】
- 实现iFrame自适应高度
- javascript实现iframe 高度自适应(经典)
- 为何firefox不支持insertRow和insertCell。我如何能让firefox显示和ie显示的效果一样?iframe实现高度自适应,兼容FF、Opera、Safari
- js脚本实现iframe框架自适应高度
- 实现iFrame自适应高度,原来很简单!
- 如何实现iframe(嵌入式帧)的自适应高度
- 实现跨域Iframe高度自适应调整
- 如何实现iframe(嵌入式帧)的自适应高度
- jquery 实现iframe高度自适应
- js实现iframe自适应高度
- iframe自适应内层页面高度,可响应页面中折叠点击事件,以及实现跨域的问题解决方案
- 跨域实现IFRAME自适应高度~续(终级)
- iframe自适应高度和宽度 全css实现无javascript
- JS实现iframe自适应高度的方法示例
- javascirpt实现IFrame自适应高度
- jquery实现iframe自适应高度代码
- 实现iFrame自适应高度