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>
```
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值