zoukankan      html  css  js  c++  java
  • IFrame自动适应宽高,去掉空白

    主页调用iFrame如下:

    <iframe src="Index.aspx" align=middle id="mainFrame" onload='this.height=document.frames["mainFrame"].document.body.scrollHeight' hspace="0" vspace="0" 
                                        WIDTH
    ='100%' marginwidth=0 MARGINHEIGHT=0 FRAMEBORDER='0' SCROLLING='no' ></iframe>

    iFrame页(子页)调用JS函数,可调整主页调用的iFrame的高度

    <SCRIPT LANGUAGE="JavaScript">
                
    function frameStyleResize()
                {                
                    
    var HeightValue = document.body.scrollHeight;                    
                    
    if(HeightValue < 700)
                    {    
                        HeightValue 
    = 700;
                    } 
                    parent.document.getElementById(
    "mainFrame").style.height = HeightValue;            
                }        
            
    </SCRIPT>

    <body onload="frameStyleResize();">
  • 相关阅读:
    aspscheduler+uwsgi定时任务执行多次
    django定时任务
    django记录用户操作模块
    python缩小图片
    pymysql同时执行多条语句时报错
    MySQL8.0 修改密码
    linux中安装python3
    Mysql高性能
    Mysql高性能
    Mysql高性能
  • 原文地址:https://www.cnblogs.com/hanguoji/p/949952.html
Copyright © 2011-2022 走看看