From 40b45df555bd3a0f41ce3c92380aac8c98efdc0c Mon Sep 17 00:00:00 2001 From: 10295 <1029559041@qq.com> Date: Sun, 13 May 2018 20:57:40 +0800 Subject: [PATCH] =?UTF-8?q?bootstrap=E8=8F=9C=E5=8D=95=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main/webapp/WEB-INF/jsp/index.jsp | 32 +++--- web/src/main/webapp/WEB-INF/jsp/menu.jsp | 128 +++++++++++----------- 2 files changed, 83 insertions(+), 77 deletions(-) diff --git a/web/src/main/webapp/WEB-INF/jsp/index.jsp b/web/src/main/webapp/WEB-INF/jsp/index.jsp index b5ab4e5..9cd6edb 100644 --- a/web/src/main/webapp/WEB-INF/jsp/index.jsp +++ b/web/src/main/webapp/WEB-INF/jsp/index.jsp @@ -28,16 +28,26 @@ }); $("#tabs").on('click', 'button', function () { + $(this).addClass('active'); - $($(this).attr('href')).addClass('active show'); - $($(this).attr('href')).siblings().removeClass('active show') $(this).siblings().removeClass('active'); + $($(this).attr('href')).addClass('active show'); + $($(this).attr('href')).siblings().removeClass('active show'); + $("#menu"+$(this).data('id')).addClass('active show'); + $("#menu"+$(this).data('id')).siblings().removeClass('active show'); }); $("#tabs").on('click', 'i', function () { - $(this).parent().remove(); - $($(this).parent().attr('href')).remove(); + button=$(this).parent(); + $(button.attr('href')).remove(); + if(button.next().length==0){ + button.prev().click(); + }else{ + button.next().click(); + } + + button.remove(); }); }); @@ -61,21 +71,13 @@ - -