在iframe的页面里面加上window.onload=function(){
if(document.body.scrollHeight>3000)
parent.document.all.iframeName.style.height=document.body.scrollHeight;
else
parent.document.all.iframeName.style.height=3000;
}

解决方案 »

  1.   

    iframe的高度不指定。在product.php中加入如下的代码
    <body onLoad="parent.document.demo.height= document.body.scrollHeight">
      

  2.   

    在子文档中加入
    parent.document.all.tags("IFRAME")[window.name].height=document.body.scrollHeight;
    前提是父文档中没有重名的iframe对象.
    这种方式避免了父文档在控制子文档的时候,对子文档状态进行判断的问题.