• jquery左侧菜单


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>左侧菜单</title>
        <style>
            .outer{
                height: 1000px;
                 100%;
            }
            .menu{
                float: left;
                background-color: beige;
                 30%;
                height: 500px;
            }
            .content{
                float: left;
                background-color: red;
                 70%;
                height: 500px;
            }
            .title{
                background-color: aquamarine;
                line-height: 40px;
            }
            .hide{
                display: none;
            }
        </style>
    </head>
    <body>
    <div class="outer">
        <div class="menu">
            <div class="item">
                <div class="title" onclick="show(this)">菜单一</div>
                <div class="con">
                    <div>111</div>
                    <div>111</div>
                    <div>111</div>
                </div>
            </div>
            <div class="item">
                <div class="title" onclick="show(this)">菜单二</div>
                <div class="con hide">
                    <div>222</div>
                    <div>222</div>
                    <div>222</div>
                </div>
            </div>
            <div class="item">
                <div class="title " onclick="show(this)">菜单三</div>
                <div class="con hide">
                    <div>333</div>
                    <div>333</div>
                    <div>333</div>
                </div>
            </div>
        </div>
        <div class="content"></div>
    </div>
    <script src="/static/jquery.min.js"></script>
    <script>
        function show(self) {
            $(self).next().removeClass('hide');
            $(self).parent().siblings().children('.con').addClass('hide');
        }
    </script>
    </body>
    </html>
    
  • 相关阅读:
    1、数据加密基础
    cookie——小甜品
    使用SpringBoot开发REST服务
    从编辑距离、BK树到文本纠错
    360影视视频下载
    从Trie树到双数组Trie树
    使用websocket-sharp来创建c#版本的websocket服务
    OFFICE 文档转换为html在线预览
    IDEA+PHP+XDebug调试配置
    HTML5录音控件
  • 原文地址:https://www.cnblogs.com/wangyue0925/p/9181510.html
Copyright © 2020-2023  润新知