Template:CSS/UT-Tokyo/Counter/Contents
From 2014.igem.org
(Difference between revisions)
Pineappler (Talk | contribs) |
Pineappler (Talk | contribs) |
||
Line 484: | Line 484: | ||
function open(name){ | function open(name){ | ||
var node = document.getElementById(name); | var node = document.getElementById(name); | ||
+ | |||
+ | var list = new Array(7); | ||
+ | list(0) = "Project"; | ||
+ | list(1) = "Result"; | ||
+ | list(2) = "Lab"; | ||
+ | list(3) = "Modeling"; | ||
+ | list(4) = "Achievement"; | ||
+ | list(5) = "Attribution"; | ||
+ | list(6) = "Humanpractice"; | ||
+ | |||
+ | var i; | ||
+ | for(i = 0;i<7;i++){ | ||
+ | if(list(i) != name){ | ||
+ | close(list(i)); | ||
+ | } | ||
+ | } | ||
if(node.childNodes[0].childNodes[0].src.indexOf("open") == -1){ | if(node.childNodes[0].childNodes[0].src.indexOf("open") == -1){ | ||
Line 494: | Line 510: | ||
node.childNodes[0].childNodes[0].alt = temp; | node.childNodes[0].childNodes[0].alt = temp; | ||
} | } | ||
+ | |||
+ | function close(name){ | ||
+ | var node = document.getElementById(name); | ||
+ | |||
+ | if(node.childNodes[0].childNodes[0].src.indexOf("open") != -1){ | ||
+ | node.childNodes[2].style.display = "block"; | ||
+ | }else{ | ||
+ | node.childNodes[2].style.display = "none"; | ||
+ | } | ||
+ | var temp = node.childNodes[0].childNodes[0].src; | ||
+ | node.childNodes[0].childNodes[0].src = node.childNodes[0].childNodes[0].alt; | ||
+ | node.childNodes[0].childNodes[0].alt = temp; | ||
+ | } | ||
+ | |||
function getNodes(){ | function getNodes(){ |