Template:UCSF/subnav/Hello/BBB/AAA

From 2010.igem.org

(Difference between revisions)
Line 108: Line 108:
   for (var i=1;i<result.length;i++){
   for (var i=1;i<result.length;i++){
     var nav = document.createElement('li');
     var nav = document.createElement('li');
-
    if(i==1){
+
     if(i!=result.length-1){nav.className+="parent parent-"+(i+1);}
-
      nav.className="first ";
+
-
    }
+
-
     if(i!=result.length-1){nav.className+="parent parent-"+i;}
+
     if(i==result.length-1){
     if(i==result.length-1){
-
      if(i==1){nav.className+="current";}
+
        nav.className="current";
-
      else{nav.className="current";}
+
     }
     }
     var loc = "http:\/\/2010.igem.org\/Team:UCSF";
     var loc = "http:\/\/2010.igem.org\/Team:UCSF";
     for(var j=1;j<=i;j++){loc+=result[j];}
     for(var j=1;j<=i;j++){loc+=result[j];}
     nav.innerHTML="<a href=\""+loc+"\">"+result[i]+"<\/a>";
     nav.innerHTML="<a href=\""+loc+"\">"+result[i]+"<\/a>";
-
     if(nav.className=="current"||nav.className=="first current"){nav.innerHTML="<span>"+result[i].substr(1)+"<\/span>";}
+
     if(nav.className=="current"){nav.innerHTML="<span>"+result[i].substr(1)+"<\/span>";}
     subnav.appendChild(nav);
     subnav.appendChild(nav);
   }
   }

Revision as of 02:26, 10 October 2010