框架自适应高度实例

<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

你可能感兴趣的:(JavaScript,html,jquery,框架)