Team:Tsinghua/writenav
From 2010.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
+ | |||
<html><script> | <html><script> | ||
- | function writenav(navlist, linklist) | + | function writenav(navlist, linklist, lightno, subno) |
{ | { | ||
navRoot =document.getElementById("subnav"); | navRoot =document.getElementById("subnav"); | ||
j=0; | j=0; | ||
+ | k=0; | ||
for (i=0; i<navRoot.childNodes.length; i++) | for (i=0; i<navRoot.childNodes.length; i++) | ||
{ | { | ||
Line 10: | Line 12: | ||
{ | { | ||
node.childNodes[0].innerHTML=navlist[j]; | node.childNodes[0].innerHTML=navlist[j]; | ||
- | node.childNodes[0].href= | + | node.childNodes[0].href=linklist[j]; |
+ | if(j==lightno) | ||
+ | { | ||
+ | node.childNodes[0].className+="nowat"; | ||
+ | } | ||
+ | if(subno!=null) | ||
+ | { | ||
+ | if(k<subno.length) | ||
+ | { | ||
+ | if(j==subno[k]) | ||
+ | { | ||
+ | node.childNodes[0].className+="subtitle"; | ||
+ | k++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
node.style.display="none"; | node.style.display="none"; | ||
j++; | j++; |
Revision as of 15:18, 13 October 2010