zoukankan      html  css  js  c++  java
  • iframe的高度自适应

    <script>
    function SetWinHeight(obj) {
        var win = obj;
        if (document.getElementById) {
            if (win && !window.opera) {
                if (win.contentDocument&& win.contentDocument.body.offsetHeight)
                    win.height = win.contentDocument.body.offsetHeight;
                else if (win.Document && win.Document.body.scrollHeight)
                    win.height = win.Document.body.scrollHeight;
            }
        }
    }
    </script>

    上面是iframe高度自适应的js代码,把它插入到自己写的iframe标签的onload=" "属性中即可(推荐js写到<head>标签内部)。

    html如下:

    <div>
    <iframe src="http://192.168.3.91:8080/cobo/portal/comment.ptview" scrolling="no" frameborder="0" 
        width="100%" height="100%" onload="Javascript:SetWinHeight(this)">
    </iframe>
    </div>

    <!-- 顺带写上jsp动态include引入页面和传参的方式 -->
    <jsp:include page="showCommentPortal.jsp">
        <jsp:param name="infoLinkId" value="<%=infoLink.getInfoLinkId()%>" />
        <jsp:param name="infoSortId" value="<%=infoSort.getInfoSortId()%>" />
    </jsp:include>
  • 相关阅读:
    文件搜索和图像裁剪
    Mat的复制
    map
    substr
    cin,scanf
    strstr
    Applying vector median filter on RGB image based on matlab
    sobel算子的一些细节
    matlab 有趣小细节
    高斯混合模型(GMM)
  • 原文地址:https://www.cnblogs.com/is1988/p/2575839.html
Copyright © 2011-2022 走看看