• 选项卡


    <!--[if lt IE 9]>
    <script type="text/javascript" src="${CONTEXT_PATH}/manage-views/lib/html5.js"></script>
    <script type="text/javascript" src="${CONTEXT_PATH}/manage-views/lib/respond.min.js"></script>
    <script type="text/javascript" src="${CONTEXT_PATH}/manage-views/lib/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="${CONTEXT_PATH}/manage-views/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="${CONTEXT_PATH}/manage-views/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="${CONTEXT_PATH}/manage-views/lib/Hui-iconfont/1.0.7/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="${CONTEXT_PATH}/manage-views/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="${CONTEXT_PATH}/manage-views/static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="${CONTEXT_PATH}/manage-views/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->

    <style>
    .tab{400px;height:400px;border:1px solid red;}
    .tab-menu{height:100px;400px;border:1px solid grey;}
    .tab-menu ul{list-style:none;}
    .tab-menu li{display:block;30%;float:left;border:1px solid blue;}
    .tab-box div{400px;height:300px;border:1px solid #ff4200;display:none;}
    /* 让第一个框显示出来 */
    .tab-box div:first-Child{display:block;}
    /* 改变选项卡选中时候的样式 */
    .change{background:red;}
    </style>
    <body>
    <div class="tab">
    <div class="tab-menu">
    <ul>
    <li>新服</li>
    <li>爆服</li>
    <li>大服</li>
    </ul>
    </div>
    <div class="tab-box">
    <div>123</div>
    <div>456</div>
    <div>789</div>
    </div>
    </div>
    </body>

    <script type="text/javascript" src="${CONTEXT_PATH}/manage-views/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="${CONTEXT_PATH}/manage-views/static/h-ui/js/H-ui.js"></script>
    <script type="text/javascript" src="${CONTEXT_PATH}/manage-views/static/h-ui.admin/js/H-ui.admin.js"></script>
    <script type="text/javascript" src="${CONTEXT_PATH}/manage-views/lib/layer/2.1/layer.js"></script>
    <script type="text/javascript">

    $().ready(function(){
    $(".tab-menu li").click(function(){
    //通过 .index()方法获取元素下标,从0开始,赋值给某个变量
    var _index = $(this).index();
    //让内容框的第 _index 个显示出来,其他的被隐藏
    $(".tab-box div").eq(_index).show().siblings().hide();
    //改变选中时候的选项框的样式,移除其他几个选项的样式
    $(this).addClass("change").siblings().removeClass("change");
    });
    });

    $(function(){
    $(".tab-memu li").click(function(){
    var _index = $(this).index();
    $(".tab_box div").eq(_index).show().siblings().hide();
    $(this).addClass("change").slibings().removeClass("change");
    })
    })
    </script>

  • 相关阅读:
    大道至简阅读笔记08-完结
    (转)MySQL的JDBC驱动源码解析
    Win7如何开启Telnet服务
    idea 设置jetty进程jvm参数
    (转)如何在maven环境中设置JVM参数
    (转)IntelliJ Idea 常用快捷键列表 for win
    cglib Demo
    MAVEN 配置阿里巴巴镜像
    MyBatis入门基础(一)
    JAVA常见面试题之Forward和Redirect的区别
  • 原文地址:https://www.cnblogs.com/feiwenstyle/p/10509217.html
Copyright © 2020-2023  润新知