zoukankan      html  css  js  c++  java
  • Html之 IFrame使用,注意几点

    0x01 iframe的跳出框架

    0x02 iframe样式设置

    0x03 iframe重置高度

    1、首先来一个,跳出iframe的好方法,直接可以在Login.aspx页面使用。

    if (window.parent.[IFRAME外壳的某方法]) {
        top.location.href = "Login.aspx";
    }

    2、再来段比较好看的iframe

    <script type="text/javascript">
        function SetWinHeight() {
            var obj = document.getElementById("content");
            var win = obj;
            if (win && !window.opera) {
                if (win.contentDocument && win.contentDocument.body.offsetHeight)
                    win.height = win.contentDocument.body.offsetHeight + 20;
                else if (win.Document && win.Document.body.scrollHeight)
                    win.height = win.Document.body.scrollHeight + 20;
            }
        }
    
        window.onresize = function () {
            SetWinHeight();
        }
    </script>
    <div class="page-body">
        <iframe id="content" src="None.aspx" name="content" onload="javascript:SetWinHeight()" frameborder="0"
            scrolling="auto" style="min-height: 700px;" height="100%" width="100%"></iframe>
    </div>

    3、子页面的使用,子页面,在调整大小后,可以调用父页面的SetWinHeight就可用把布局弄好看了。

    if (window.parent.SetWinHeight)
            window.parent.SetWinHeight();

    仅仅作为一个记录。方便查找。

  • 相关阅读:
    感悟.学习的方式
    IOS地理信息使用
    IOSTimer的例子留个备注
    IOSSelector的用法
    ios中addtarget的用法
    ios绘图时的坐标处理
    mac下装Ruby
    iOSbase64
    ios跳转
    Misha and Palindrome Degree CodeForces
  • 原文地址:https://www.cnblogs.com/Supperlitt/p/6211327.html
Copyright © 2011-2022 走看看