div+js实现iframe效果[转]

[转] https://blog.csdn.net/wpy1282316637/article/details/68484553

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="iFrameWeb2.aspx.cs" Inherits="web2_test.iFrameWeb2" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="author" content="Chomo" />
    <link rel="start" href="http://www.14px.com" title="Home" />
    <title>div仿框架布局</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        html {
            height: 100%;
            overflow: hidden;
            background: #fff;
            /*---ie6---*/
            _padding: 70px 10px;
        }
        body {
            height: 100%;
            overflow: hidden;
            background: #fff;
        }

        div {
            background: #f60;
            line-height: 1.6;
        }

        .top {
            position: absolute;
            left: 10px;
            top: 10px;
            right: 10px;
            height: 50px;
            /*---ie6---*/
            _height: 50px;
            _margin-top: -60px;
            _margin-bottom: 10px;
            _position: relative;
            _top: 0;
            _right: 0;
            _bottom: 0;
            _left: 0;
        }

        .side {
            position: absolute;
            left: 10px;
            top: 70px;
            bottom: 70px;
            width: 200px;
            overflow: auto;
            /*---ie6---*/
            _height: 100%;
            _float: left;
            _width: 200px;
            _position: relative;
            _top: 0;
            _right: 0;
            _bottom: 0;
            _left: 0;
        }


        .main {
            position: absolute;
            left: 220px;
            top: 70px;
            bottom: 70px;
            right: 10px;
            overflow: auto;
            /*---ie6---*/
            _height: 100%;
            _margin-left: 207px;
            _position: relative;
            _top: 0;
            _right: 0;
            _bottom: 0;
            _left: 0;
        }



        .bottom {
            position: absolute;
            left: 10px;
            bottom: 10px;
            right: 10px;
            height: 50px;
            /*---ie6---*/
            _height: 50px;
            _margin-top: 10px;
            _position: relative;
            _top: 0;
            _right: 0;
            _bottom: 0;
            _left: 0;
        }
   
        li a {
            float: left;
            width: 200px;
            display: block;
        }
    </style>

    <script src="scripts/jquery-1.10.2.min.js"></script>

 

```javascript
   <script>
        /** 初始化加载页面 **/
        jQuery(document).ready(function () {
            document.getElementById("iframe").src = 'index.htm';
        })
        /****   网页跳转到页面顶部  ****/
        function parentGoTop() {
            $(function () {
                $('html, body').animate({
                    scrollTop: 0
                }, 0);
            });
        }
        /****  根据链接地址跳转页面   ****/
        function clicklist(uri) {
            document.getElementById("iframe").src = uri;
            parentGoTop();
        }
    </script>
<form id="form1" runat="server">
    <div>


        <div class="top"></div>
        <div class="side">
            <ul class='menu'> 
                <li><strong>资源专版快讯管理</strong></li>
                <li><a onclick="clicklist('guagedemo.aspx');">发布网上资源/供求专版 </a></li>
                <li><a onclick="clicklist('DataTable/DistinctDatatable.aspx');">推荐资源发布</a></li>
                <li><a onclick="clicklist('Treeview.aspx');">供求快讯发布</a></li>
                <li><a onclick="clicklist('WebForm1.aspx');">供求快讯重发/修改/删除</a></li>
            </ul>
        </div>
        <div class="main">
            <iframe id="iframe" src="" height='850px' width="700" frameborder="0" scrolling="yes"></iframe>
        </div>
        <div class="bottom"></div>
    </div>
</form>
```
上一篇:html css 设置表格单元格横线


下一篇:jquary实现tab栏切换(附上代码)