Iframe 它的高度如何控制?
解决方案 »
- AIR 的程序如何与.net 后台交互的?
- 请问在gridView中怎么样根据其中的一个字段排序
- 数据库是ACCESS,表名是table,有3个字段,怎么用命令再加一个字段?在线F5
- 如何计算出两个日期格式的字符串相差几天
- 广告管理系统(解决后马上给分)
- DataTable.Select("name<>'a'") 如何让他不排序,50分
- 熟悉ASP.net+VB.net+Access编程的朋友请进,小弟有问题请教,急!!!!!!
- 大家能否提供C#+asp.net的代码能登录到exchange server 2000上去,谢谢!
- 建.dll文件遇到的问题,编译保错!没有高手吗!
- 框架的问题??
- 分页SQL语句的问题
- 求一个短日期格式
<iframe src=page.htm id="PageIframe"></iframe>
page.htm的代码:
<script>
function resize()
{parent.document.all.PageIframe.height=document.body.scrollHeight;}
</script>
<body onload="resize()">
</body>
function autoResize()
{
try
{
document.all["content"].style.height=content.document.body.scrollHeight
}
catch(e){}
}
</script>
<iframe src="main.htm" name="content" id="content" scrolling="no" frameborder="0" width="100%" onload="autoResize();"></iframe>
<iframe src='public_detailMain.asp' width="100%" height="100%" id='dd' name="dd" scrolling=no scroll="auto" border="0" noresize frameborder="0" marginheight=1 marginwidth=1></iframe>public_detailMain.asp 的页面
<body onload="parent.document.all.dd.style.height=document.body.scrollHeight">
<script language="javascript" type="text/javascript">
//高度自适应
function frame()
{
var fmheight =1000;
var win=document.getElementById("iframe的ID");//
try
{
if (win.contentDocument && win.contentDocument.body.offsetHeight)
fmheight = win.contentDocument.body.offsetHeight;
else if(win.Document && win.Document.body.scrollHeight)
fmheight = win.Document.body.scrollHeight;
}
catch(e){}
win.height = fmheight;
}
</script>
然后在iframe中使用onload方法加载这个函数就可以了
style="width: 180px; height: 140px">
</iframe>