Team:Uppsala/Templates/TselectTier2
From 2014.igem.org
(Difference between revisions)
Line 3: | Line 3: | ||
<ul id="tabs"> | <ul id="tabs"> | ||
- | |||
- | |||
- | |||
- | |||
</ul> | </ul> | ||
</div> | </div> | ||
+ | <script> | ||
+ | var data = window.location.href; | ||
+ | var List = document.getElementById("links"); | ||
+ | if (data.search("Team") !== -1) | ||
+ | { | ||
+ | document.getElementById("currentH").innerHTML = "Team"; | ||
+ | createA("Team1", "#"); | ||
+ | createA("Team2", "#"); | ||
+ | createA("Team3", "#"); | ||
+ | } | ||
+ | else if (data.search("Project") !== -1) | ||
+ | { | ||
+ | document.getElementById("currentH").innerHTML = "Project"; | ||
+ | createA("Adhesion", "http://example.com"); | ||
+ | createA("Killling", "http://example.com"); | ||
+ | createA("Sensing", "http://example.com"); | ||
+ | createA("Targeting", "http://example.com"); | ||
+ | |||
+ | } | ||
+ | else if (data.search("Modeling")!== -1) | ||
+ | { | ||
+ | document.getElementById("currentH").innerHTML = "Modeling"; | ||
+ | createA("Simulation", "http://example.com"); | ||
+ | createA("Matlab", "http://example.com"); | ||
+ | } | ||
+ | else if (data.search("Parts")!== -1) | ||
+ | { | ||
+ | document.getElementById("currentH").innerHTML = "Parts"; | ||
+ | createA("Colicin", "http://example.com"); | ||
+ | createA("YenR", "http://example.com"); | ||
+ | createA("USP45", "http://example.com"); | ||
+ | } | ||
+ | else if (data.search("Human")!== -1) | ||
+ | { | ||
+ | document.getElementById("currentH").innerHTML = "Human Practice"; | ||
+ | createA("Overview", "http://example.com"); | ||
+ | createA("Outreach", "http://example.com"); | ||
+ | createA("Continuity", "http://example.com"); | ||
+ | } | ||
+ | else if (data.search("Notebook")!== -1) | ||
+ | { | ||
+ | document.getElementById("currentH").innerHTML = "Notebook"; | ||
+ | createA("Protocols", "http://example.com"); | ||
+ | createA("Experiments", "http://example.com"); | ||
+ | createA("Results", "http://example.com"); | ||
+ | } | ||
+ | else if (data.search("Safety")!== -1) | ||
+ | { | ||
+ | document.getElementById("currentH").innerHTML = "Safety"; | ||
+ | createA("Safety", "http://example.com"); | ||
+ | createA("More safety", "http://example.com"); | ||
+ | createA("Max safety", "http://example.com"); | ||
+ | } | ||
+ | else if (data.search("Attributions")!== -1) | ||
+ | { | ||
+ | document.getElementById("currentH").innerHTML = "Attributions"; | ||
+ | createA("Attributions 1", "http://example.com"); | ||
+ | createA("Attributions 2", "http://example.com"); | ||
+ | createA("Attributions 2", "http://example.com"); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | alert("Sorry something failed"); | ||
+ | } | ||
+ | |||
+ | |||
+ | function createA(text, link) { | ||
+ | var node = document.createElement("li"); | ||
+ | var a = document.createElement('a'); | ||
+ | var linkText = document.createTextNode(text); | ||
+ | a.appendChild(linkText); | ||
+ | a.href = link; | ||
+ | node.appendChild(a); | ||
+ | document.getElementById("tab_selector").appendChild(node); | ||
+ | } | ||
+ | |||
+ | |||
+ | </script> | ||
</html> | </html> |
Revision as of 13:41, 16 July 2014