jquery里iframe自适应高度

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
    <title>YUI Grids CSS</title>  
    <%@ include file="/common/meta.jsp" %>  
    <link href="${ctx}/css/yui.css" mce_href="${ctx}/css/yui.css" type="text/css" rel="stylesheet"/>  
    <link href="${ctx}/css/style.css" mce_href="${ctx}/css/style.css" type="text/css" rel="stylesheet"/>  
    <link href="${ctx}/css/left.css" mce_href="${ctx}/css/left.css" type="text/css" rel="stylesheet"/>  
    <mce:script src="${ctx}/js/jquery.js" mce_src="${ctx}/js/jquery.js" type="text/javascript"></mce:script>  
    <mce:script type="text/javascript"><!--  
    $(document).ready(function() {  
        $("#content").load(function(){  
            var mainheight = $(this).contents().find("body").height()+30;  
            $(this).height(mainheight);  
        });  
        $('.urbangreymenu li a').click(function() {  
            $('.urbangreymenu li a').removeClass('currentClickMenu');  
            $(this).addClass('currentClickMenu');  
        });  
          
        $('.headerbar').click(function() {  
            $(this).next().toggle();  
        });  
    });  
// --></mce:script>  
</head>  
<body>  
<div id="doc3" class="yui-t2">  
   <div id="hd" >  
    <%@ include file="/common/header.jsp" %>  
   </div>  
   <div id="bd" >  
    <div class="yui-b">  
        <%@ include file="/common/left.jsp" %>  
    </div>  
    <div id="yui-main">  
        <div class="yui-b">  
            <div class="yui-g">  
                <iframe frameborder="0" src="basic/bank-trunk!input.action" mce_src="basic/bank-trunk!input.action" width="100%" id="content" name="content" scrolling="no"></iframe>  
            </div>  
        </div>  
    </div>      
    </div>  
    <%@ include file="/common/footer.jsp" %>  
</div>  
</body>  
</html>  


你可能感兴趣的:(jquery)