背景:将引入页的<body bgcolor="ffffff">
自适应高度:
<script type="text/javascript">
function SetCwinHeight(){
var bobo=document.getElementById("bobo"); //iframe id
if (document.getElementById){
if (bobo && !window.opera){
if (bobo.contentDocument && bobo.contentDocument.body.offsetHeight){
bobo.height = bobo.contentDocument.body.offsetHeight;
}else if(bobo.Document && bobo.Document.body.scrollHeight){
bobo.height = bobo.Document.body.scrollHeight;
}
}
}
}
</script>
<iframe width="100%" id="bobo" height="1" frameborder="0" src="/default.asp?cateID=1"></iframe>
iframe 自适应高度及背景
最新推荐文章于 2019-09-05 17:01:44 发布