iframe自动适应宽高度
来源:互联网 发布:2016源码交易网站 编辑:程序博客网 时间:2024/05/28 17:06
页面a.html代码如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>a</title>
<style type="text/css">
body{margin:auto; text-align:center;}
div{margin:auto; text-align:center;}
</style>
<script type="text/javascript">
function getBody_WandH(){
var headH = window.frames["head"].document.body.scrollHeight;
var headW = window.frames["head"].document.body.scrollWidth;
var head = document.getElementById("head");
head.style.cssText = "width:" + headW + "px; " + "height:" + headH + "px;";
}
window.onload = getBody_WandH;
</script>
</head>
<body>
<iframe id="head" name="head" frameborder="0" scrolling="no" src="b.html"></iframe><br />
</body>
</html>
页面b.html的代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>b</title>
<style type="text/css">
body{margin:0px; padding:0px; text-align:center;}
div{margin:auto; text-align:center;}
</style>
</head>
<body>
<div id="bdiv" style="width:360px; height:360px;">
<div style="width:350px; height:350px; background:#999; border:1px solid #00F;">
<span id="b_aid" onclick="getStr();">我是b页面的div.</span>
</div>
</div>
</body>
</html>
不明白的也可以联系我,给我留言:QQ770890212
- iframe自动适应宽高度
- iframe高度自动适应
- iframe自动适应高度
- iframe 高度自动适应
- Iframe自动适应高度
- iframe高度自动适应
- IFRAME 自动适应高度
- Iframe自动适应高度
- iframe自动适应高度
- iframe自动适应高度
- iframe 自动适应高度
- iframe 自动适应高度
- iframe高度自动适应
- iframe高度自动适应
- iframe 自动适应高度
- iframe自动适应高度
- 用iframe自动适应高度
- iframe高度自动适应代码
- HTML !DOCTYPE 标签
- 《Java 本地接口规范》- JNI 函数(三)
- VC中加快链接的小技巧
- IBM大型机技术学习笔记(二) —— IBM 企业级Linux 服务
- Boost下载安装编译配置使用指南(含Windows和Linux)
- iframe自动适应宽高度
- 《Java 本地接口规范》- 调用 API
- 浏览器性能评测报告(一):评测项目
- WinInet开发Internet客户端应用
- c++的三种继承方式
- Visual Studio: the specified file is an unrecognized or unsupported binary format
- java 数据转换,输出相关操作
- linux设备驱动程序学习笔记——主次设备号
- WinInet(1)