### html代碼html
<div class="multi-menu"> <div class="item"> <div class="title"><span class="icon-wrap"><i class="fa fa-free-code-camp"></i></span> 信息管理</div> <div class="body hide"> <a href=" " class="">繳費記錄列表</a > </div> </div> <div class="item"> <div class="title"><span class="icon-wrap"><i class="fa fa-free-code-camp"></i></span> 客戶管理</div> <div class="body "> <a href="/customer/list/" class="active">客戶列表</a > </div> </div> </div>
### jq代碼ide
(function (jq) { jq('.multi-menu .title').click(function () { // $(this).next().toggleClass('hide'); $(this).next().removeClass('hide'); $(this).parent().siblings().find('.body').addClass('hide'); }); })(jQuery);