红包只抢不发遭骂报警,古灵精探b 粤语,李咏 国母
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=gb2312'>
<meta name='author' content='站长中国 http://www.zzcn.net/'>
<title>iframe自适应加载的页面高度</title>
</head>
<body>
<iframe src="child.htm"></iframe>
</body>
</html>
child.htm:
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=gb2312'>
<meta name='author' content='站长中国 http://www.zzcn.net/'>
<title>iframe 自适应其加载的网页(多浏览器兼容)</title>
<script language=javascript>
function iframeautofit()
{
try
{
if(window!=parent)
{
var a = parent.document.getelementsbytagname("iframe");
for(var i=0; i<a.length; i++) //author:meizz
{
if(a[i].contentwindow==window)
{
var h = document.body.scrollheight;
if(document.all) {h += 4;}
if(window.opera) {h += 1;}
a[i].style.height = h;
}
}
}
}
catch (ex)
{
alert("脚本无法跨域操作!");
}
}
if(document.attachevent) window.attachevent("onload", iframeautofit);
else window.addeventlistener('load', iframeautofit, false);
</script>
</head>
<body>
<div style="width: 200; height: 400; background-color: yellow">
iframe 自适应其加载的网页(多浏览器兼容)
</div>
</body>
</html>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
详解CSS3新增的背景属性
CSS3新增属性:background-clip ,background-origin , background-size,本文给大家分享CSS3新增的背景属性...
[阅读全文]
-
-
-
CSS3 旋转立方体问题详解
这篇文章主要介绍了CSS3 旋转立方体问题详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学...
[阅读全文]
-
Grid 宫格常用布局的实现
这篇文章主要介绍了Grid 宫格常用布局的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学...
[阅读全文]
-
-
-
CSS3实现网站商品展示效果图
这篇文章主要介绍了CSS3实现网站商品展示效果图,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习...
[阅读全文]
-
网友评论