Template:Team:HKU-HKBU/script.js

From 2009.igem.org

(Difference between revisions)
 
(17 intermediate revisions not shown)
Line 173: Line 173:
function removeTitle(){
function removeTitle(){
-
   var el = document.getElementByTagName("h1")[0];
+
   var el = document.getElementsByTagName("h1")[0];
   if (el != null) {
   if (el != null) {
     if (el.childNodes) {
     if (el.childNodes) {
Line 182: Line 182:
     }
     }
   }
   }
 +
}
 +
 +
function modifyTopBar(){
 +
  var el = document.getElementById("tabs");
 +
  var aNodes = el.getElementsByTagName("a");
 +
    for (var i = 0; i < aNodes.length; i++) {
 +
      if (aNodes[i].getAttribute("href") == document.URL) {
 +
        aNodes[i].style.backgroundPosition="0% -42px";
 +
        var sNode = aNodes[i].getElementsByTagName("span")[0];
 +
        sNode.style.backgroundPosition="100% -42px";
 +
      }
 +
    }
}
}
</script>
</script>
</html>
</html>

Latest revision as of 12:38, 18 October 2009