上左右布局

上左右布局

上、左、右布局页面

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>发布统计系统</title>
</head>
<body style="margin: 0;overflow: hidden;">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td height="100">
            <iframe id="iframe_top" name="iframe_top" src="${request.contextPath}/info/getTopHtml" width="100%"
                    height="100" allowtransparency="true" scrolling="no" border="0" frameborder="0"></iframe>
        </td>
    </tr>
    <tr>
        <td>
            <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="20%">
                        <iframe id="iframe_left" name="iframe_left" src="${request.contextPath}/info/getLeftHtml"
                                width="100%" allowtransparency="true" border="0" scrolling="no"
                                frameborder="0"></iframe>
                    </td>
                    <td>
                        <iframe id="iframe_main" name="iframe_main" src="${request.contextPath}/info/getMainHtml"
                                width="100%" allowtransparency="true" border="0" scrolling="no"
                                frameborder="0"></iframe>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</body>
<script>
    /**
     * 调整iframe高度
     */
    function changeFrameHeight() {
        var top_height = document.getElementById("iframe_top");
        if (top_height) {
            top_height = top_height.height;
        } else {
            top_height = 0;
        }
        document.getElementById("iframe_left").height = document.documentElement.clientHeight - top_height;
        document.getElementById("iframe_main").height = document.documentElement.clientHeight - top_height;
    }
    /**
     * 窗口变化时调整iframe高度
     */
    window.onresize = function () {
        changeFrameHeight();
    }
    window.onload = function () {
        changeFrameHeight();
    }
</script>
</html>

右侧主页面tab

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>右侧主页面</title>
    <script type="text/javascript" src="${request.contextPath}/assets/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${request.contextPath}/assets/js/layer/layer.js"></script>
    <style type="text/css">
        ol, ul, dl {
            list-style: none;
            margin: 0;
            padding: 0;
            border: 0;
        }

        a {
            text-decoration: none;
            color: #333;
            cursor: pointer;
        }

        a:focus {
            outline: none;
        }

        .tabbox .clearfix:after {
            content: "";
            display: block;
            clear: both;
        }

        .tabbox ul li {
            float: left;
            padding: 9px 0;
            height: 23px;
            line-height: 23px;
        }

        .tabbox ul li a {
            padding: 0 30px;
        }

        .tabbox ul li a.haveborder {
            border-right: 1px solid #c3c3c3;
        }

        .tabbox ul li.on {
            background-color: #fff;
            border-top: 2px solid #ff7f27;
            margin-top: -1px;
            height: 21px;
            line-height: 21px;
        }

        .tabbox ul li.on a {
            border-right: none;
        }
    </style>
</head>
<body style="margin: 5px 0px 0px 5px;">
<div class="tabbox"
     style="width: 100%;background-color: #e7e7e7;height: 40px;line-height: 40px;border-top: 1px solid #c3c3c3;margin: 0px auto;font-size: 16px;position: relative;top: 0;left: 0;bottom: 0;right: 0;">
    <ul class="clearfix">
        <li id="year" class="on" style="display: none;">
            <a href="javascript:tab('${request.contextPath}/dept/getDeptDesc?type=${type}&id=${ID}&upperID=${upperID}&nodePath=${nodePath}')">年度统计(年)</a>
        </li>
        <li id="quarter" style="display: none;">
            <a href="javascript:tab('')">季度统计(季)</a>
        </li>
        <li id="month" style="display: none;">
            <a href="javascript:tab('')">月份统计(月)</a>
        </li>
        <li id="week" style="display: none;">
            <a href="javascript:tab('http://www.baidu.com')">周统计(周)</a>
        </li>
        <li id="day" style="display: none;">
            <a href="javascript:tab('')">月统计(日)</a>
        </li>
        <li id="hour" style="display: none;">
            <a href="javascript:tab('http://www.baidu.com')">日统计(小时)</a>
        </li>
    </ul>
    <iframe id="iframe" name="iframe" src="" width="100%" height="500" allowtransparency="true"
            border="0" frameborder="0"></iframe>
</div>
<script>
    /**
     * iframe赋值
     * @param url
     */
    function tab(url) {
        var aLi = $('.tabbox ul li');
        aLi.click(function () {
            aLi.removeClass('on');
            $(this).addClass('on');
        });
        $("#iframe").attr("src", url);
    }
    /**
     * 点击li时触发内部的a标签的点击事件
     */
    $("ul").on("click", "li", function () {
        $("a", this)[0].click();
    });
    /**
     * 调整iframe高度
     */
    function changeFrameHeight() {
        document.getElementById("iframe").height = parent.document.getElementById("iframe_main").height - 40;
    }
    /**
     * 窗口变化时调整iframe高度
     */
    window.onresize = function () {
        changeFrameHeight();
    }
    $(function () {
        changeFrameHeight();
        //加载页面默认触发class=on的标签
        $('.clearfix').find(".on").find("a")[0].click();

        $("#year").show();
        $("#quarter").show();
        $("#month").show();
        $("#week").show();
        $("#day").show();
        $("#hour").show();

        //设置默认触发tab
//        $("#hour").show();
//        $("#hour").find("a")[0].click();

    });
</script>
</body>
</html>

 上一篇
windows vscode右键菜单 windows vscode右键菜单
windows vscode右键菜单新建任意名称的reg后缀文件,复制写入下面内容执行即可。(vscode安装路径替换为自己的) Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROO
2019-08-19
下一篇 
使用jquery 使用jquery
使用jquery.form.js进行上传Spring mvc进行上传操作,原本简单的form表单用submit提交就可以,但是需要有回调。这个方式就无法满足了,在网上找了找可以用jquery.form.js进行上传操作,下面看代码。表单部分
2019-08-19
  目录