webenh
网上查了好多用着都不行,自己搞定了:在包含iframe的页面中加入以下脚本,基本思想是在iframe加载内容后重新设置高度,下面代码尽在IE6中用过,没在其他浏览器中测试。

 

代码如下:

<script type="text/javascript"> 
<!-- 
$( 
    function() 
    {                     
     //iframe高度随内容自动调整 
        $(\'.main\').load( 
         function() 
            { 
                $(this).height($(this).contents().find("body").attr(\'scrollHeight\')); 
            } 
        ); 
    } 
);      
// --> 
</script>

 

分类:

技术点:

相关文章:

  • 2021-09-07
  • 2021-12-22
  • 2021-09-07
  • 2021-08-03
  • 2021-09-12
  • 2021-10-18
  • 2021-09-07
猜你喜欢
  • 2021-12-12
  • 2021-12-12
  • 2021-12-12
  • 2021-12-22
  • 2021-12-12
  • 2021-11-04
相关资源
相似解决方案