Team:Tsinghua/writenav
From 2010.igem.org
(Difference between revisions)
(11 intermediate revisions not shown) | |||
Line 12: | Line 12: | ||
node.childNodes[0].innerHTML=navlist[j]; | node.childNodes[0].innerHTML=navlist[j]; | ||
node.childNodes[0].href=linklist[j]; | node.childNodes[0].href=linklist[j]; | ||
- | |||
- | |||
- | |||
- | |||
if(subno!=null) | if(subno!=null) | ||
{ | { | ||
if(k<subno.length) | if(k<subno.length) | ||
{ | { | ||
- | |||
if(j==subno[k]) | if(j==subno[k]) | ||
{ | { | ||
node.childNodes[0].className+="subtitle"; | node.childNodes[0].className+="subtitle"; | ||
+ | node.childNodes[0].innerHTML="»" + navlist[j]; | ||
k++; | k++; | ||
} | } | ||
} | } | ||
} | } | ||
+ | if(j==lightno) | ||
+ | { | ||
+ | node.childNodes[0].style.color="yellow"; | ||
+ | } | ||
+ | |||
node.style.display="none"; | node.style.display="none"; | ||
j++; | j++; | ||
Line 39: | Line 40: | ||
inisize=9; | inisize=9; | ||
tarsize=11; | tarsize=11; | ||
+ | utarsize=11; | ||
inipadd=0; | inipadd=0; | ||
tarpadd=25; | tarpadd=25; | ||
+ | utarpadd=25; | ||
var anim; | var anim; | ||
animate = function() | animate = function() | ||
{ | { | ||
- | navRoot =document.getElementById("subnav"); | + | navRoot = document.getElementById("subnav"); |
+ | k = 0; j = 0; | ||
for (i=0; i<navRoot.childNodes.length; i++) | for (i=0; i<navRoot.childNodes.length; i++) | ||
{ | { | ||
Line 50: | Line 54: | ||
if(node.nodeName=="LI") | if(node.nodeName=="LI") | ||
{ | { | ||
+ | if(subno!=null) | ||
+ | { | ||
+ | if(subno.length>k) | ||
+ | { | ||
+ | |||
+ | if(j==subno[k]) | ||
+ | { | ||
+ | tarsize=8; | ||
+ | tarpadd=8; | ||
+ | k++; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | tarsize=11; | ||
+ | tarpadd=25; | ||
+ | } | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | tarsize=11; | ||
+ | tarpadd=25; | ||
+ | } | ||
+ | } | ||
+ | j++; | ||
if(inisize<=tarsize) | if(inisize<=tarsize) | ||
{ | { | ||
Line 57: | Line 85: | ||
if(inipadd<=tarpadd) | if(inipadd<=tarpadd) | ||
{ | { | ||
- | node.childNodes[0].style.paddingLeft = inipadd + "px"; | + | node.childNodes[0].style.paddingLeft = inipadd+ "px"; |
node.childNodes[0].style.paddingRight = inipadd + "px"; | node.childNodes[0].style.paddingRight = inipadd + "px"; | ||
inipadd+=0.1; | inipadd+=0.1; | ||
} | } | ||
- | if(inisize> | + | if(inisize>utarsize) |
{ | { | ||
- | if(inipadd> | + | if(inipadd>utarpadd) |
{ | { | ||
clearInterval(anim); | clearInterval(anim); |
Latest revision as of 15:48, 26 October 2010