Authored by fanzelei

update

@@ -42,9 +42,9 @@ @@ -42,9 +42,9 @@
42 <div id="sidebar"> 42 <div id="sidebar">
43 <ul> 43 <ul>
44 <li class=""><a href="#"><i class="icon icon-home"></i> <span>Dashboard</span></a></li> 44 <li class=""><a href="#"><i class="icon icon-home"></i> <span>Dashboard</span></a></li>
45 - <li class="active" onclick="clickMenuToPage('/jsp/table.jsp')"><a href="#" ><i class="icon icon-th"></i> <span>Tables</span></a></li>  
46 - <li><a href="#" onclick="clickMenuToPage('jsp/host/hostGroupList.jsp')"><i class="icon icon-th"></i> <span>主机组</span></a></li>  
47 - <li><a href="#" onclick="clickMenuToPage('jsp/host/hostInfoList.jsp')"><i class="icon icon-th"></i> <span>主机信息</span></a></li> 45 + <li class="" id="jsptablejsp" onclick="clickMenuToPage('/jsp/table.jsp')"><a href="#" ><i class="icon icon-th"></i> <span>Tables</span></a></li>
  46 + <li class="" id="jsphosthostGroupListjsp" onclick="clickMenuToPage('jsp/host/hostGroupList.jsp')" ><a href="#" ><i class="icon icon-th"></i> <span>主机组</span></a></li>
  47 + <li class="" id="jsphosthostInfoListjsp" onclick="clickMenuToPage('jsp/host/hostInfoList.jsp')" ><a href="#" ><i class="icon icon-th"></i> <span>主机信息</span></a></li>
48 48
49 49
50 </ul> 50 </ul>
@@ -56,7 +56,8 @@ @@ -56,7 +56,8 @@
56 56
57 <script type="text/javascript"> 57 <script type="text/javascript">
58 function clickMenuToPage(page){ 58 function clickMenuToPage(page){
59 - // $(this).addClass("active"); 59 + var g = page.replace(/\//g,"").replace(".","");
  60 + $("#"+g).addClass("active").siblings().removeClass("active");
60 //加载左侧内容 61 //加载左侧内容
61 $("#content").load(contextPath+page); 62 $("#content").load(contextPath+page);
62 } 63 }