• ligerUI布局时,Center中的Tab高度太小问题解决


    1.0 引用的js,css

        <link href="/Content/scripts/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" />
        <link href="/Content/scripts/ligerUI/skins/ligerui-icons.css" rel="stylesheet" />
        <script src="~/Scripts/jquery-1.8.2.js"></script>
        <script src="/Content/scripts/ligerUI/js/ligerui.all.js"></script>

    2.0 用js代码设置ligerUI布局和Tab高度

     <script>
            var tab;
            $(function () {
                $("#layout1").ligerLayout({ leftWidth: 200, topHeight: 80 });
                $("#accordion1").ligerAccordion({ height: 300 });
    
                //重要的代码,设置新增加的tab的高度等于center div的高度.
                var height = $(".l-layout-center").height();
                tab = $("#tab1").ligerTab({ height: height });
            });
    
            //可以动态增加一个tab标签页,但是元素有哪些
            function addTab(url, text, tabid) {
                tab.addTabItem({ url: url, text: text, tabid: tabid });
            }
        </script>

    3.0 简单的设置样式

        <style type="text/css">
            body { padding: 10px; margin: 0; }
            #layout1 { width: 100%; margin: 40px; height: 400px; margin: 0; padding: 0; }
            #accordion1 { height: 270px; }
            h4 { margin: 20px; }
            #accordion1 ul li { font-size: 14px; margin-left: 15px; }
            a { color: black; text-decoration: none; }
            a:hover { color: #ff6a00; }
        </style>

    4.0 body中的内容

    <body style="padding:10px">
        <div id="layout1">
            <div position="left" title="功能列表">
                <div id="accordion1">
                    <div title="项目管理">
                        <ul>
                            <li><a href="javascript:void(0)" onclick="addTab( 'http://www.youku.com','指定队伍',  1 )">指定队伍</a></li>
                            <li><a href="javascript:void(0)" onclick="addTab( 'http://www.jd.com','查看项目',  2 )">查看项目</a></li>
                        </ul>
                    </div>
                    <div title="用户管理">
                        <ul>
                            <li><a href="javascript:void(0)" onclick="addTab('http://www.baidu.com','用户审核', 3 )">用户审核</a> </li>
                            <li><a href="javascript:void(0)" onclick="addTab( 'http://www.sina.com','查看用户', 4 )">查看用户</a></li>
                        </ul>
                    </div>
                    <div title="其他" style="padding:10px">
                        其他内容
                    </div>
                </div>
            </div>
            <div position="center" id="tab1">
    
            </div>
            <div position="top" style="line-height: 80px;">
                <span style="font-size: 28px;font-weight: bolder;font-family:楷体;">超级管理员后台</span>
                <span><a href='@Url.Action("LoginOut","Admin")' style="margin-right: 20px;font-size: 18px;color: #0000cd;float: right;">退出</a></span>
            </div>
            <div position="bottom"></div>
        </div>
    
    </body>
    欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。如果感觉对您有用,请点击推荐。您的支持,是我的动力!
  • 相关阅读:
    matplotlib油漆基础
    使用ant编译项目技能
    [Recompose] Refactor React Render Props to Streaming Props with RxJS and Recompose
    [Recompose] Make Reusable React Props Streams with Lenses
    [Recompose] Compose Streams of React Props with Recompose’s compose and RxJS
    [Recompose] Create Stream Behaviors to Push Props in React Components with mapPropsStream
    [Recompose] Stream Props to React Children with RxJS
    [Recompose] Merge RxJS Button Event Streams to Build a React Counter Component
    [Recompose] Handle React Events as Streams with RxJS and Recompose
    [Recompose] Stream a React Component from an Ajax Request with RxJS
  • 原文地址:https://www.cnblogs.com/ICE_Inspire/p/4990485.html
Copyright © 2020-2023  润新知