Template:UCSF/subnav
From 2010.igem.org
(Difference between revisions)
(43 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
<style> | <style> | ||
- | + | #breadcrumbs ul{margin:0;padding:0;} | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
#sub-navigation { | #sub-navigation { | ||
margin: 0; | margin: 0; | ||
} | } | ||
+ | #breadcrumbs{ | ||
+ | height:20px; | ||
+ | width:auto; | ||
+ | border:1px grey solid; | ||
+ | border-bottom:none; | ||
+ | padding: 0px; | ||
+ | } | ||
#breadcrumbs li { | #breadcrumbs li { | ||
+ | list-style:none; | ||
+ | margin:0px; | ||
+ | padding:0px; | ||
+ | font:11px arial,helvetica,clean,sans-serif; | ||
padding: 0; | padding: 0; | ||
float: left; | float: left; | ||
Line 73: | Line 77: | ||
color: #fff; | color: #fff; | ||
margin: 0; | margin: 0; | ||
- | padding: 5px | + | padding: 5px 18px 5px 20px; |
background-image: url(http://www.nature.com/view/nature/landing/styles/images/background-dark-grey-crumb.png); | background-image: url(http://www.nature.com/view/nature/landing/styles/images/background-dark-grey-crumb.png); | ||
border: 0 none; | border: 0 none; | ||
Line 92: | Line 96: | ||
</style> | </style> | ||
+ | |||
<script> | <script> | ||
- | |||
- | |||
- | |||
function getLadder(){ | function getLadder(){ | ||
var PageURL = document.URL; | var PageURL = document.URL; | ||
- | var reg = /http:\/\/2010\.igem\.org\/ | + | var reg = /http:\/\/2010\.igem\.org\/Team:UCSF(.*)/; |
- | var | + | var re = reg.exec(PageURL); |
+ | var result; | ||
+ | if(re[1]=="") | ||
+ | { | ||
+ | var subnav = document.getElementById('breadcrumbs'); | ||
+ | //subnav.style.display="none"; | ||
+ | return; | ||
+ | } | ||
+ | result=re[1].split("\/"); | ||
+ | |||
var subnav=document.getElementById('sub-navigation'); | var subnav=document.getElementById('sub-navigation'); | ||
for (var i=1;i<result.length;i++){ | for (var i=1;i<result.length;i++){ | ||
var nav = document.createElement('li'); | var nav = document.createElement('li'); | ||
- | if(i= | + | if(i!=result.length-1){nav.className+="parent parent-"+(i+1);} |
- | + | ||
- | + | ||
- | + | ||
if(i==result.length-1){ | if(i==result.length-1){ | ||
- | + | nav.className="current"; | |
} | } | ||
var loc = "http:\/\/2010.igem.org\/Team:UCSF"; | var loc = "http:\/\/2010.igem.org\/Team:UCSF"; | ||
- | for(var j=1;j<=i;j++){loc+=result[j];} | + | for(var j=1;j<=i;j++){loc+="\/";loc+=result[j];} |
- | nav.innerHTML="<a href=\""+loc+"\">"+result[i] | + | nav.innerHTML="<a href=\""+loc+"\">"+result[i]+"<\/a>"; |
+ | if(nav.className=="current"){nav.innerHTML="<span>"+result[i]+"<\/span>";} | ||
subnav.appendChild(nav); | subnav.appendChild(nav); | ||
} | } | ||
} | } | ||
- | |||
</script> | </script> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
</html> | </html> |
Latest revision as of 10:33, 18 October 2010