• 兼容各浏览器的iframe方法


    方法一:(推荐1)

    <iframe id="frame_content" src="/Home/CreateGroup?classID=@ViewBag.ClassID" scrolling="no" frameborder="0" height="100%" width="82%"></iframe>
    <script type="text/javascript">
    $("#frame_content").load(function () {
    $(this).height($(this).contents().height());
    })
    </script>

    方法二:

    <iframe id="frame_content" src="/Home/GroupIndex?classID=@ViewBag.ClassID" scrolling="no" frameborder="0" onload="this.height=100" width="82%"></iframe>
    <script type="text/javascript">
    function reinitIframe() {
    var iframe = document.getElementById("frame_content");
    try {
    var bHeight = iframe.contentWindow.document.body.scrollHeight;
    var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
    var height = Math.max(bHeight, dHeight);
    iframe.height = height;
    } catch (ex) { }
    }
    window.setInterval("reinitIframe()", 200);
    </script>

  • 相关阅读:
    对象结构型
    对象结构型
    对象行为型模式
    定时任务(二)
    定时任务(一)
    kill端口-更新sql-添加字段
    获取ip和端口号
    List集合中的末位元素置首位
    首页报表数据展示(一)
    具体的类中包括枚举类写法
  • 原文地址:https://www.cnblogs.com/ggbbeyou/p/2945712.html
Copyright © 2020-2023  润新知