浏览代码

git-svn-id: https://192.168.57.71/svn/jsgkj@869 931142cf-59ea-a443-aa0e-51397b428577

ld_jiangxf 8 年之前
父节点
当前提交
ae00a2bcbe
共有 1 个文件被更改,包括 43 次插入42 次删除
  1. 43 42
      gkjsjy/trunk/WebContent/static/biz/js/main.js

+ 43 - 42
gkjsjy/trunk/WebContent/static/biz/js/main.js

@@ -130,38 +130,49 @@ main.initMenuCss=function(){
 
 
 main.menuClick=function(code,name,url){
-		if(url.indexOf('?')==-1){
-			url+="?menuid="+code;
-		}else{
-			url+="&menuid="+code;
-		}
-		
-	    //遍历li的name值放进数组a
-	    var a= new Array();
-	    $("#tabs>li").each(function(i){
-	        a[i]= $(this).attr("code");
+	if(url.indexOf('?')==-1){
+		url+="?menuid="+code;
+	}else{
+		url+="&menuid="+code;
+	}
 	
-	    });
-	  
-	    //检查是否已加入选项卡
-	    if($.inArray(code,a)=="-1"){
-	        $(".thistab").after("<li url='"+url+"' code='"+code+"' title='"+name+"'><div><p>"+name+"</p><span></span></div></li>")   //增加对应选项卡
-	        $("#tabs>li[code='"+code+"']").addClass("thistab").siblings("li").removeClass("thistab");  //当前选项卡添加选中样式,删除其他选项卡选中样式
-//	        $("#iframepage").attr("src",$.app+url);
-	        var str = "<iframe  width='100%'  class='iframepage' style=\"min-height:450px;\" src='"+$.app+url+"' id='"+code+"'  frameborder='no'  name='iframepage' border='0'   ></iframe>";
-	        $("#tabs_content").append(str);
-	        showOrHide(code);
-	    }else{
-	    	 $("#tabs>li[code='"+code+"']").addClass("thistab").siblings("li").removeClass("thistab");  //当前选项卡添加选中样式,删除其他选项卡选中样式
-//	        $("#iframepage").attr("src",$.app+url);
-	    	 $("#"+code).attr("src",$.app+url);
-	    	 $("#"+code).css("display","block");
-	    	 showOrHide(code);
-	    }
-	    $("#tabs>li[code='"+code+"']").addClass("thistab").siblings("li").removeClass("thistab");  //当前选项卡添加选中样式,删除其他选项卡选中样式
-        $("#iframepage").attr("src",$.app+url);
-	    tab();
-	    jqtab("#tabs","#tabs_content","click");
+    //遍历li的name值放进数组a
+    var a= new Array();
+    $("#tabs>li").each(function(i){
+        a[i]= $(this).attr("code");
+
+    });
+  
+    //检查是否已加入选项卡
+    if($.inArray(code,a)=="-1"){
+		
+        $(".thistab").after("<li url='"+url+"' code='"+code+"' title='"+name+"'><div><p>"+name+"</p><span></span></div></li>")   //增加对应选项卡
+        $("#tabs>li[code='"+code+"']").addClass("thistab").siblings("li").removeClass("thistab");  //当前选项卡添加选中样式,删除其他选项卡选中样式
+//        $("#iframepage").attr("src",$.app+url);
+        var str = "<iframe  width='100%'  class='iframepage' style=\"min-height:450px;\" src='"+$.app+url+"' id='"+code+"'  frameborder='no'  name='iframepage' border='0'   ></iframe>";
+        $("#tabs_content").append(str);
+        showOrHide(code);
+    }else{
+    	 $("#tabs>li[code='"+code+"']").addClass("thistab").siblings("li").removeClass("thistab");  //当前选项卡添加选中样式,删除其他选项卡选中样式
+//        $("#iframepage").attr("src",$.app+url);
+    	 $("#"+code).attr("src",$.app+url);
+    	 $("#"+code).css("display","block");
+    	 showOrHide(code);
+    }
+    $("#tabs>li[code='"+code+"']").addClass("thistab").siblings("li").removeClass("thistab");  //当前选项卡添加选中样式,删除其他选项卡选中样式
+    $("#iframepage").attr("src",$.app+url);
+    
+	/*
+	if($.inArray(code,a)=="-1"){
+
+		tabmove();
+	}else{
+		tabmove(code);
+	}
+	*/
+	tabmove(code,$.inArray(code,a)=="-1");
+	//tab();
+    jqtab("#tabs","#tabs_content","click");
 };
 
 main.initTab=function(){
@@ -175,17 +186,7 @@ main.initTab=function(){
 	$("#tab>.tabs>.thistab").css("z-index", "101");
 	plus=0;
 	clicktab();
-	/*
-	if($.inArray(code,a)=="-1"){
-
-		tabmove();
-	}else{
-		tabmove(code);
-	}
-	*/
-	tabmove(code,$.inArray(code,a)=="-1");
-	//tab();
-	
+	tab();
 	jqtab("#tabs","#tabs_content","click");
 };