jQuery实例 - 左侧菜单

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
          .menu{
              height: 600px;
              width: 30%;
              background-color: #2F4F4F;
              float: left;
          }
         .title{
             line-height: 50px;
             color: #ddd;
         }
         .title:hover{
             cursor: pointer;
             color: lightcyan;
             font-size: 18px;
         }
         .hide{
             display: none;
         }
    </style>
</head>

<body>
    <div>
        <div>
            <div>
                <div onclick="Show(this);">菜单一</div>
                <div>
                    <div>111</div>
                    <div>111</div>
                    <div>111</div>
                </div>
            </div>
            <div>
                <div onclick="Show(this);">菜单二</div>
                <div class="con hide">
                    <div>222</div>
                    <div>222</div>
                    <div>222</div>
                </div>
            </div>
            <div>
                <div onclick="Show(this);">菜单三</div>
                <div class="con hide">
                    <div>333</div>
                    <div>333</div>
                    <div>333</div>
                </div>
            </div>
        </div>
    </div>

    <script src="../../jquery-1.12.4.js"></script>
    <script>
        function Show(self) {
            $(self).next().removeClass("hide").parent().siblings().children(".con").addClass("hide");
        }
    </script>
</body>
</html>