Iframe自适应高度兼容ie,firefox多浏览器
摘要:复制代码代码如下:functionSetCwinHeight(){varbobo=document.getElementById("bobo...
复制代码 代码如下:
<scripttype="text/javascript">
functionSetCwinHeight(){
varbobo=document.getElementById("bobo");//iframeid
if(document.getElementById){
if(bobo&&!window.opera){
if(bobo.contentDocument&&bobo.contentDocument.body.offsetHeight){
bobo.height=bobo.contentDocument.body.offsetHeight;
}elseif(bobo.Document&&bobo.Document.body.scrollHeight){
bobo.height=bobo.Document.body.scrollHeight;
}
}
}
}
</script>
<iframewidth="100%"id="bobo"onload="Javascript:SetCwinHeight()"height="1"frameborder="0"src="/default.asp?cateID=1"></iframe>
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
【Iframe自适应高度兼容ie,firefox多浏览器】相关文章:
上一篇:
自定义标签实现圆角边框
下一篇:
IE之死__原来与CSS有关