Template:Team:HKU-HKBU/script.js

From 2009.igem.org

(Difference between revisions)
Line 26: Line 26:
     document.write("\
     document.write("\
       <div class=\"seper\" style=\"width:" + seperWidth + "px\"></div>\
       <div class=\"seper\" style=\"width:" + seperWidth + "px\"></div>\
-
       <div class=\"tab" + ((document.URL.indexOf(pageName) != -1) ? "sel" : "") + "\" style=\"width:" + tabWidths[i] + "px\">\
+
       <div class=\"tab" + ((document.URL.indexOf("/" + pageName) != -1) ? "sel" : "") + "\" style=\"width:" + tabWidths[i] + "px\">\
         <a href=\"https://2009.igem.org/Team:HKU-HKBU/" + pageName + "\">" + tabNames[i] + "</a>\
         <a href=\"https://2009.igem.org/Team:HKU-HKBU/" + pageName + "\">" + tabNames[i] + "</a>\
       </div>");
       </div>");
Line 74: Line 74:
         document.write("\
         document.write("\
           <div class=\"seper\" style=\"height:" + minorSeperHeight + "px\"></div>\
           <div class=\"seper\" style=\"height:" + minorSeperHeight + "px\"></div>\
-
           <div class=\"linktab" + ((document.URL.indexOf(pageName) != -1) ? "sel" : "") + "\">\
+
           <div class=\"linktab" + ((document.URL.indexOf("/" + pageName) != -1) ? "sel" : "") + "\">\
             <a href=\"https://2009.igem.org/Team:HKU-HKBU/" + pageName + "\">" + minorTabNames[j] + "</a>\
             <a href=\"https://2009.igem.org/Team:HKU-HKBU/" + pageName + "\">" + minorTabNames[j] + "</a>\
           </div>");
           </div>");
Line 82: Line 82:
       var pageName = majorTabNames[i].replace(/ /g, "_").toLowerCase();
       var pageName = majorTabNames[i].replace(/ /g, "_").toLowerCase();
       document.write("\
       document.write("\
-
         <div class=\"linktab" + ((document.URL.indexOf(pageName) != -1 || document.URL + pageName == "https://2009.igem.org/Team:HKU-HKBU" + "home") ? "sel" : "") + "\">\
+
         <div class=\"linktab" + ((document.URL.indexOf("/" + pageName) != -1 || document.URL + pageName == "https://2009.igem.org/Team:HKU-HKBU" + "home") ? "sel" : "") + "\">\
           <a href=\"https://2009.igem.org/Team:HKU-HKBU/" + pageName + "\">" + majorTabNames[i].toUpperCase() + "</a>\
           <a href=\"https://2009.igem.org/Team:HKU-HKBU/" + pageName + "\">" + majorTabNames[i].toUpperCase() + "</a>\
         </div>");
         </div>");

Revision as of 13:32, 8 October 2009