//鍒濆鍖栬彍鍗 function getHeaderMenuData(){ $.ajax({ type : 'post', url : rootPath + '/index/getHeaderMenu', beforeSend: function () { showLoad(); }, success : function(data) { initHeaderMenu(data); }, error : function(XMLHttpRequest, textStatus, errorThrown) { if(errorThrown == "Forbidden" || XMLHttpRequest.status == "403" || XMLHttpRequest.status == "404"){ layer.alert(ForbiddenMsg,{icon: 7},function(){ window.location.href = rootPath; }); }else{ layer.alert(errorThrown,{icon: 7},function(){ window.location.href = rootPath; }); } }, complete: function(XMLHttpRequest, textStatus) { closeLoad(); } }); } //鍒濆鍖栧悓姝ヨ彍鍗 function initHeaderMenu(data){ //缁勭粐涓€绾ц彍鍗曞紑濮 var menuTree = getTree(data, "-1"); var inner = ""; var targetBlank = ""; for(var i=0;i"+ ""+ menuTree[i]["F_NAME"]+""; } document.getElementById("firstTopMenu").innerHTML = inner; //缁勭粐涓€绾ц彍鍗曠粨鏉 //缁勭粐浜岀骇鑿滃崟寮€濮 var thirdInner = ""; var secondInner = ""; for(var i=0;i 0){ if(menuTree[i]["child"][0]["child"].length > 0){ thirdInner += ""; } } document.getElementById("showdiv").innerHTML = secondInner; document.getElementById("showdiv").innerHTML += thirdInner; setColor(); } function showDetialMenu(id){ var showDiv = $("#showdiv"); showDiv.hide(); showDiv.find("div.wrap").hide(); if(showDiv.find("#"+id).length > 0){ showDiv.show(); showDiv.find("#"+id).slideDown("slow"); } } function hideDetialMenu(){ var showDiv = $("#showdiv"); showDiv.hide(); } function setColor(){ var pathname = window.location.pathname; $('#firstTopMenu li').each(function () { if($(this).attr("id") == pathname){ $(this).addClass("cur"); } }) }