据b.htm的大小动态的改变iframe的大小,在b.htm中
法1.
function changeIframeHeight() //自动改变 Iframe 的高度
{
if(top != self)
{
window.parent.document.getElementById(self.name).height = document.body.scrollHeight;
}
}
function window.onload()
{
changeIframeHeight(); //改变 Iframe 高
}
法2.
<script language="javascript">
<!--
function toppage()
{
if (self.location!=top.location)
{
parent.document.all(self.name).height=document.body.scrollHeight + 30;
parent.document.all(self.name).width=document.body.scrollWidth + 30;
}
}
-->
</script>
<body onload="toppage()">
法1.
function changeIframeHeight() //自动改变 Iframe 的高度
{
if(top != self)
{
window.parent.document.getElementById(self.name).height = document.body.scrollHeight;
}
}
function window.onload()
{
changeIframeHeight(); //改变 Iframe 高
}
法2.
<script language="javascript">
<!--
function toppage()
{
if (self.location!=top.location)
{
parent.document.all(self.name).height=document.body.scrollHeight + 30;
parent.document.all(self.name).width=document.body.scrollWidth + 30;
}
}
-->
</script>
<body onload="toppage()">
解决方案 »
- window.parent fckeditor access denied——很郁闷的问题
- JS实现这个效果
- ====请教一个表格过滤问题,麻烦帮帮忙 :)=====
- javascript对话框问题
- 请问在同一个页面中,提交任务前,能不能先保存表单?
- 请问"event.srcElement.previousSibling.previousSibling.uniqueID" 是什么意思?
- 我问个jquery的问题吧:为什么我写的这点代码,在IE中不兼容
- 运行javascript的程序对ie的版本有要求马?
- 送分问题:为何滚屏代码不工作 ?
- 求助!form 表单中无法调用js代码而form外可以调用
- 关于jacascript脚本的加密技术~
- 请问关于网页的问题
var obj = document.all["myIframe"];
var h = obj.document.body.scrollHeight + 30;
alert(h);得到的结果与 b.htm中的不一样,原因?