Jquery easy UI 上中下三栏布局 分类: ASP.NET ...

效果图:


源代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Jquery easy UI 上中下三栏布局</title>
    <link href="jquery-easyui-1.4/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script src="jquery-easyui-1.4/jquery.min.js" type="text/javascript"></script>
    <script src="jquery-easyui-1.4/jquery.easyui.min.js" type="text/javascript"></script>
</head>
<body>
    <div class="easyui-layout" id="mainLayout" border="false">
        <div id="topPanel" data-options="region:'north',split:true" title="顶部部分">
        </div>
        <div id="centerPanel" data-options="region:'center',split:true" title="中间部分">
        </div>
        <div id="bottomPanel" data-options="region:'south',split:true" title="底部部分">
        </div>
    </div>
    <script type="text/javascript">
        window.customResize = function () {
            var width = $(window).width() - 10;
            var height = $(window).height();
            var panelHeight = parseInt(height / 3); //每个1/3高度
            $('#topPanel').panel('resize', { width: width, height: panelHeight });
            $('#centerPanel').panel('resize', { width: width, height: panelHeight });
            $('#bottomPanel').panel('resize', { width: width, height: panelHeight });
            $('#mainLayout').layout('resize', { width: width, height: height });
        };
    </script>
    <script type="text/javascript">
        //窗口缩放时,重绘布局控件尺寸 
        $(function () {
            redraw();
        });

        $(window).resize(function () {
            redraw();
        });

        function redraw() {
            if (window.customResize) {
                customResize(); //自定义缩放函数,页面若使用多个布局控件,需自定义缩放函数处理
            } else {
                var width = $(window).width();
                var height = $(window).height();

                //没有自定义缩放函数时,默认对panel,layout,treegrid,datagrid等控件进行调整
                $('.easyui-panel').panel('resize', { width: width, height: height });
                $('.easyui-layout').layout('resize', { width: width, height: height });
                $('.easyui-treegrid').treegrid('resize', { width: width, height: height });
                $('.easyui-datagrid').datagrid('resize', { width: width, height: height });
            }
        } 
    </script>
</body>
</html>
完整示例:

http://qingshanboke.com/Uploadfiles/file/20150206/6355881114276855463509463.rar

版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值