此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【yyzzgg】截止到2008-07-23 15:33:25的历史汇总数据(不包括此帖):
发帖的总数量:21 发帖的总分数:380 每贴平均分数:18
回帖的总数量:16 得分贴总数量:0 回帖的得分率:0%
结贴的总数量:17 结贴的总分数:310
无满意结贴数:0 无满意结贴分:0
未结的帖子数:4 未结的总分数:70
结贴的百分比:80.95 % 结分的百分比:81.58 %
无满意结贴率:0.00 % 无满意结分率:0.00 %
楼主加油
楼主【yyzzgg】截止到2008-07-23 15:33:25的历史汇总数据(不包括此帖):
发帖的总数量:21 发帖的总分数:380 每贴平均分数:18
回帖的总数量:16 得分贴总数量:0 回帖的得分率:0%
结贴的总数量:17 结贴的总分数:310
无满意结贴数:0 无满意结贴分:0
未结的帖子数:4 未结的总分数:70
结贴的百分比:80.95 % 结分的百分比:81.58 %
无满意结贴率:0.00 % 无满意结分率:0.00 %
楼主加油
解决方案 »
- Struts2 JSP 怎么在<property value="name"/> 取得当前name 的值
- Spring的mvc跳转
- JAVA 调用 .NET写的WEB SERVICE的问题(SOAP头验证 )
- 面试必问问题?
- Jxl高手请进!由于使用POI读取excel错误,无法导入数据库,求Jxl读取excel导入数据库的代码。
- 本姑娘求救--关于字符的问题??????????????
- JFreeChart画一条直线代表警戒线
- 为什麽jsp中树型控件点击后没有方应?
- 答者有分!(100),多选框全选功能,怎么做???
- 特急!在线等!关于javamail!
- 使用spring时配置jndi以及JtaTransactionManager的问题,谢谢。。。。
- HelloWorldServlet问题,麻烦大家帮忙一下
<iframe. src="ReallyDo.html"
name="iframe" id="iframe"
allowtransparency="true"
align="default"
marginwidth="0"
marginheight="0"
frameborder="0"
scrolling="no"
height="200"
width="100%"
onload="this.height=0;var fdh=(this.Document?this.Document.body.scrollHeight:this.contentDocument.body.offsetHeight);this.height=(fdh>200?fdh:200)//code by Tencent.nokersang&moded by ReallyDo.Jorkin"></iframe>
onload字段中的数值“200”为设置的Iframe最低高度值!
当然iframe,html要在同一子域下才可以,否则警告没有权限!
至于你要求高度也要变化..onload里面代码也是可以参考的.祝你好运!
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 h1=0,w1=0, h2=0,w2=0, d=document, dd=d.documentElement;
a[i].parentNode.style.height = a[i].offsetHeight +"px";
a[i].style.height = "10px";
if(dd && dd.scrollHeight) h1=dd.scrollHeight;
if(dd && dd.scrollWidthHeight) h2=dd.scrollWidth;
if(d.body) h2=d.body.scrollHeight;
if(d.body) w2=d.body.scrollWidth;
var h=Math.max(h1, h2);
var w = Math.max(w1,w2);
if(document.all) {h += 4;}
if(window.opera) {h += 1;}
a[i].style.height = a[i].parentNode.style.height = h +"px";
}
}
}
}
catch (ex){}
}
if(window.attachEvent)
{
window.attachEvent("onload", iframeAutoFit);
//window.attachEvent("onresize", iframeAutoFit);
}
else if(window.addEventListener)
{
window.addEventListener('load', iframeAutoFit, false);
//window.addEventListener('resize', iframeAutoFit, false);
}
</script>
//自动调整iframe高度
function autoResize()
{
try
{
document.all["ifr"].style.height=ifr.document.body.scrollHeight
}
catch(e)
{}
}
</script><iframe id="ifr" width="1002" style="height:expression(1); aho:expression(autoResize())" scrolling="no" src="index1.asp"></iframe>
ifr 是iframe的ID,index1.asp 是父框架指向的内容页面,该内容页面的所有连接标签为 self 模式,打开的页面的高度将匹配到父框架并使父框架自动调整。
a[i].style.width= "10px";
a[i].style.width= a[i].parentNode.style.width= h +"px";
还有你嵌套的时候把WIDTH 和 HEIGHT 都设置为0好了。。
main.htm
<html>
<body>
<div>
<iframe id=frmDetail scrolling=no name=mm src="tb.htm" onload="style.width=this.contentWindow.document.all.tblDetail.offsetWidth;style.height=this.contentWindow.document.all.tblDetail.offsetHeight"></iframe>
</div>
</body>
</html>
tb.htm <html>
<body leftmargin=0 topmargin=0>
<table id=tblDetail width=100 height=100 border=0 bgcolor=red>
<tr><td>
dddddddddddddddddddddddddddddddddddddddddddddddddddddddd
</td></tr>
</table>
</body>
</html>