欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

框架自适应高度实例

程序员文章站 2022-04-18 09:20:41
...
<html> 
<div   id="div111"   align="center">
<IFRAME   id="frm"   style="WIDTH:   100%"   border="0"   name="List"   arginWidth="0" 
  frameSpacing="0"   marginHeight="0"   src="test2.html"   frameBorder="0" 
    noResize   width="100%"   scrolling="no"   height="100%"   vspale="0"   align="middle">
    
    </IFRAME>   
  </div>   
 
</html>

 index.html

 

<html> <body> 
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   
<br>aaaaaaaaaaaaaaaaaaaaa   




<script src="jquery-1.2.6.js" type="text/javascript"></script>   
    <script type="text/javascript">   
        $(function() {   
            setFrmHeight();   
        });   
        function setFrmHeight() {   
            var frm = $(window.parent.document).find("#frm");   
            var height = $(document).height();  
		//alert(height); 
            frm.height(height);   
        }   
    </script>  
 </body>  
 
</html>

 test2.html