Template:UCSF/subnav

From 2010.igem.org

(Difference between revisions)
 
(36 intermediate revisions not shown)
Line 1: Line 1:
<html>
<html>
<style>
<style>
-
 
+
#breadcrumbs ul{margin:0;padding:0;}
-
li{
+
-
list-style:none;
+
-
margin:0px;
+
-
padding:0px;
+
-
font:11px arial,helvetica,clean,sans-serif;
+
-
}
+
-
  ul,li{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 20px 5px 22px;
+
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 makesubNav(){
 
-
 
-
}
 
function getLadder(){
function getLadder(){
var PageURL = document.URL;
var PageURL = document.URL;
-
var reg = /http:\/\/2010\.igem\.org\/Template:UCSF(\/[^\/]+)?/;
+
var reg = /http:\/\/2010\.igem\.org\/Team:UCSF(.*)/;
-
var result =  reg.exec(PageURL);
+
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==1){
+
     if(i!=result.length-1){nav.className+="parent parent-"+(i+1);}
-
      nav.className="first ";
+
-
    }
+
-
    nav.className+="parent parent-"+i;
+
     if(i==result.length-1){
     if(i==result.length-1){
-
      nav.className="current";
+
        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].substr(1)+"<\/a>";
+
     nav.innerHTML="<a href=\""+loc+"\">"+result[i]+"<\/a>";
-
//    alert(nav.innerHTML);
+
    if(nav.className=="current"){nav.innerHTML="<span>"+result[i]+"<\/span>";}
     subnav.appendChild(nav);
     subnav.appendChild(nav);
   }
   }
}
}
-
 
</script>
</script>
-
 
-
<body>
 
-
<header>
 
-
<div id="breadcrumbs">
 
-
<nav>
 
-
<ul id="sub-navigation">
 
-
<li class="first parent parent-1"><a href="./Current Issue  Nature_files/Current Issue  Nature.htm">Current Issue</a></li>
 
-
<li class="parent parent-2"><a href="http://www.nature.com/nature/journal/v467/n7316/index.html">Volume 467</a></li>
 
-
<li class="current"><span>Issue 7316</span></li>
 
-
</ul>
 
-
</nav>
 
-
</div>
 
-
</header>
 
-
 
-
<script>getLadder();</script>
 
-
</body>
 
</html>
</html>

Latest revision as of 10:33, 18 October 2010