注:onload字段中的数值“200”为设置的iframe最低高度值!
当然iframe,html要在同一子域下才可以,否则警告没有权限.
<iframe src="iframe.html" name="iframe" id="iframe" allowtransparency="true" align="default" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" height="200" width="500" 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">this message is only visible to older browsers.</iframe>
这个脚本测试可以支持ie5.5,ie6.0,firefox1.x,opera9.01
如对本文有疑问,
点击进行留言回复!!
网友评论