Template:Team:TU Munich/Menu

From 2011.igem.org

(Difference between revisions)
(Created page with "<html> <script> //Configure the script here var teamname = "TU_Delft"; // Do not edit below // Loop through the URL function buildDepth(array,count) { var depthStr=""; for (i...")
Line 1: Line 1:
<html>
<html>
<script>
<script>
-
//Configure the script here
 
-
var teamname = "TU_Delft";
 
-
// Do not edit below
 
-
// Loop through the URL
+
</script>
-
function buildDepth(array,count) {
+
<div id="menubar">
-
var depthStr="";
+
  <div id="topics">
-
for (i=0;i<count;i++)
+
  <div id="
-
{
+
    <ul id="nav_menu">
-
depthStr=depthStr + array[i] + "/" ;
+
      <li><a id="project" href="#">Project</a></li>
-
}
+
      <li><a id="team" href="#">About us</a></li>
-
return depthStr;
+
      <li><a id="lab" href="#">Lab</a></li>
-
}
+
      <li><a id="extra" href="#">Extras</a></li>
 +
    </ul>
 +
  </div>
 +
 
 +
  <div id="navarea">
 +
    <div id="nav_topics">
 +
      <p id="title">
 +
     
 +
      </p>
 +
      <ul id="nav_project" style="display: none;">
 +
        <li><a id="project" href="#">Project</a></li>
 +
        <li><a id="team" href="#">About us</a></li>
 +
        <li><a id="lab" href="#">Lab</a></li>
 +
        <li><a id="extra" href="#">Extras</a></li>
 +
      </ul>
 +
      <ul id="nav_team" style="display: none;">
 +
        <li><a id="project" href="#">Project</a></li>
 +
        <li><a id="team" href="#">About us</a></li>
 +
        <li><a id="lab" href="#">Lab</a></li>
 +
        <li><a id="extra" href="#">Extras</a></li>
 +
      </ul>
 +
      <ul id="nav_lab" style="display: none;">
 +
        <li><a id="project" href="#">Project</a></li>
 +
        <li><a id="team" href="#">About us</a></li>
 +
        <li><a id="lab" href="#">Lab</a></li>
 +
        <li><a id="extra" href="#">Extras</a></li>
 +
      </ul>
 +
      <ul id="nav_extra" style="display: none;">
 +
        <li><a id="project" href="#">Project</a></li>
 +
        <li><a id="team" href="#">About us</a></li>
 +
        <li><a id="lab" href="#">Lab</a></li>
 +
        <li><a id="extra" href="#">Extras</a></li>
 +
      </ul>
 +
    </div>
 +
  </div>
 +
</div>
-
// The function
 
-
function buildBreadCrumbTrail(page) {
 
-
// Declare vars
 
-
var constituentFolders = new Array();
 
-
var currentURL = page;
 
-
 
-
// Split the URL
 
-
constituentFolders=currentURL.split("/");
 
-
 
-
// Start with a link to the team home page
 
-
var outputStr="<a href='https://2010.igem.org/Team:'" + teamname + ">Home</a>";
 
-
 
-
// Loop through the URL
 
-
for (count=0;count<(constituentFolders.length);count++)
 
-
{
 
-
outputStr=outputStr + " > <a href='https://2010.igem.org/Team:" + teamname +
 
-
buildDepth(constituentFolders,count) + constituentFolders[count] + "'>" +
 
-
capitaliseFirstLetter(constituentFolders[count]).replace(/-/gi," ") + "</a>";
 
-
}
 
-
 
-
// Write to the div
 
-
$("#breadcrumbs").html(outputStr);
 
-
}
 
-
 
-
// Capitalize the first letter
 
-
function capitaliseFirstLetter(string) {
 
-
    return string.charAt(0).toUpperCase() + string.slice(1);
 
-
}
 
-
 
-
// Start the script upon page load
 
-
$(function() {
 
-
buildBreadCrumbTrail(window.location.pathname);
 
-
}
 
-
</script>
 
-
<div id="breadcrumbs">The breadcrumbs will show up in this div</div>
 
</html>
</html>

Revision as of 22:40, 29 June 2011