Template:Paris2009 menu6

From 2009.igem.org

(Difference between revisions)
Line 1: Line 1:
<div id="menu2">
<div id="menu2">
-
<html>
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<head>
-
<style type="text/css">
+
    <title>Menu accordéon avec jQuery</title>
-
<!--
+
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-
ul#menu {
+
<style type="text/css">
 +
 
 +
#navigation {
     width: 110px;
     width: 110px;
     margin: 20px 13px 0 7px;
     margin: 20px 13px 0 7px;
-
    position: relative;
 
     float: left;
     float: left;
-
     padding:0;
+
     padding:0px;
     list-style: none;
     list-style: none;
 +
    border-width: 0px;
}
}
-
 
+
-
ul#menu ol {
+
#navigation a, #navigation span {
-
     text-align: right;
+
     display:block;
-
     display: none;
+
     width: 110px;
-
     list-style-type: none;
+
    color: #000;
-
     margin: 0px 0;
+
     list-style: none;
-
     padding: 0;
+
     background:url(https://static.igem.org/mediawiki/2009/7/7c/Menu_Paris.png)
 +
     border-width: 0px;
}
}
-
 
+
-
ul#menu li,  
+
#navigation .toggleSubMenu a, #navigation .toggleSubMenu span {
     list-style: none;
     list-style: none;
-
     padding: 0;
+
    text-align:center;
 +
    border-width: 0px;
 +
    padding:0px;
 +
    margin:0px;
 +
}
 +
 +
#navigation .open a, #navigation .open span {
 +
    list-style: none;
 +
     padding:0;
     margin:0;
     margin:0;
-
     position: relative;  
+
     border-width: 0px;
 +
   
}
}
-
 
+
-
ul#menu li {
+
#navigation a:hover, #navigation a:focus, #navigation a:active {
-
     border-bottom: solid 1px #b9a894;
+
     font-weight:bold;
-
     line-height: 15px;
+
    color: #000;
 +
     list-style: none;
 +
    padding:0;
 +
    margin:0;
 +
    border-width: 0px;
}
}
-
 
+
-
ul#menu ol li {
+
#navigation .subMenu {
-
    color:white;
+
     background: url(https://static.igem.org/mediawiki/2009/7/7c/Menu_Paris.png)repeat;
-
    border-bottom: none;
+
    margin: 0px;
-
     background: url(https://static.igem.org/mediawiki/2009/9/9a/Menu_sub_Paris.png) no-repeat;
+
    padding-left: 10px;
 +
    color:#e4e4e4;
 +
    list-style: none;
 +
    text-align:left;
 +
    border-width: 0px;
}
}
-
 
+
-
ul#menu ol li:before {
+
#navigation ul.subMenu a {
-
     content: "";
+
     background: none;
 +
    color: white;
 +
    padding: 3px 2px;
 +
    list-style: none;
 +
    text-align:left;
 +
    border-width: 0px;
 +
    padding:0;
 +
    margin:0;
}
}
-
ul#menu a {
+
.menu_header {
     display: block;
     display: block;
     width: 110px;
     width: 110px;
-
     height: 19px;
+
     background: url(https://static.igem.org/mediawiki/2009/e/eb/Menu_header.png);
-
     color: #e4e4e4;
+
     color: #FFF;
     padding:0;
     padding:0;
-
     outline: none;
+
     margin:0;
}
}
-
ul#menu a:hover {
+
.menu_footer {
-
     display: block;
+
     width:110px;
-
     width: 110px;
+
     background: url(https://static.igem.org/mediawiki/2009/d/d5/Footer_Menu.png);
-
     height: 19px;
+
     color: #FFF;
-
     color:white;
+
     padding:0;
-
     text-decoration: underline;
+
     margin:0;
}
}
-
ul#menu a.active {
+
.open_at_load{
-
     display: block;
+
     background: url(https://static.igem.org/mediawiki/2009/7/7c/Menu_Paris.png)repeat;
-
     width: 110px;
+
     margin: 0px;
-
     height: 19px;
+
     padding-left: 2px;
-
     color:white;
+
     color:#e4e4e4;
-
     text-decoration: none;
+
     list-style: none;
-
     font-weight:bold;
+
     text-align:left;
-
     background: url(https://static.igem.org/mediawiki/2009/7/7c/Menu_Paris.png) repeat;
+
     border-width: 0px;
}
}
-
-->
+
-
</style>
+
#navigation ul.open_at_load a {
-
 
+
    background: none;
-
<script type="text/javascript">
+
    color: white;
-
<!--
+
    padding: 3px 2px;
-
/* This script and many more are available free online at
+
    list-style: none;
-
The JavaScript Source :: http://javascript.internet.com
+
    text-align:left;
-
Created by: Travis Beckham :: http://www.squidfingers.com | http://www.podlob.com */
+
    border-width: 0px;
-
 
+
    padding:0;
-
/* Coded by Travis Beckham
+
    margin:0;
-
  http://www.squidfingers.com | http://www.podlob.com
+
-
  version date: 06/02/03
+
-
  If want to use this code, feel free to do so, but please leave this message intact. */
+
-
 
+
-
// Node Functions
+
-
 
+
-
if(!window.Node){
+
-
  var Node = {ELEMENT_NODE : 1, TEXT_NODE : 3};
+
}
}
-
function checkNode(node, filter){
+
</style>
-
  return (filter == null || node.nodeType == Node[filter] || node.nodeName.toUpperCase() == filter.toUpperCase());
+
<!--[if lte IE 6]>
 +
<style type="text/css">
 +
li {
 +
    height: 1px;
}
}
-
 
+
</style>
-
function getChildren(node, filter){
+
<![endif]-->
-
  var result = new Array();
+
   
-
  var children = node.childNodes;
+
<script type="text/javascript" src="http://www.alsacreations.com/xmedia/tuto/exemples/accordeon/jquery-1.2.1.js"></script>
-
  for(var i = 0; i < children.length; i++){
+
    <script type="text/javascript">
-
     if(checkNode(children[i], filter)) result[result.length] = children[i];
+
    <!--
-
  }
+
     $(document).ready( function () {
-
  return result;
+
        // Hide subMenu
-
}
+
        // Exept the "open_at_load" :
-
 
+
        $("ul.subMenu:not('.open_at_load')").hide();
-
function getChildrenByElement(node){
+
        // On selectionne tous les items de liste portant la classe "toggleSubMenu"
-
  return getChildren(node, "ELEMENT_NODE");
+
   
-
}
+
        // replace by span:
-
 
+
        $("li.toggleSubMenu span").each( function () {
-
function getFirstChild(node, filter){
+
            // On stocke le contenu du span :
-
  var child;
+
            var TexteSpan = $(this).text();
-
  var children = node.childNodes;
+
            $(this).replaceWith('<a href="" title="Afficher le sous-menu">' + TexteSpan + '</a>') ;
-
  for(var i = 0; i < children.length; i++){
+
        } ) ;
-
    child = children[i];
+
   
-
    if(checkNode(child, filter)) return child;
+
        // modify "click" on link listed in class "toggleSubMenu" :
-
  }
+
        $("li.toggleSubMenu > a").click( function () {
-
  return null;
+
            // if subMenu is already open, we close it :
-
}
+
            if ($(this).next("ul.subMenu:visible").length != 0) {
-
 
+
                $(this).next("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") } );
-
function getFirstChildByText(node){
+
            }
-
  return getFirstChild(node, "TEXT_NODE");
+
            // if subMenu is hided, we close them :
-
}
+
            else {
-
 
+
                $("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") } );
-
function getNextSibling(node, filter){
+
                $(this).next("ul.subMenu").slideDown("normal", function () { $(this).parent().addClass("open") } );
-
  for(var sibling = node.nextSibling; sibling != null; sibling = sibling.nextSibling){
+
            }
-
    if(checkNode(sibling, filter)) return sibling;
+
            return false;
-
  }
+
        });
-
  return null;
+
   
-
}
+
    } ) ;
-
function getNextSiblingByElement(node){
+
// -->
-
        return getNextSibling(node, "ELEMENT_NODE");
+
-
}
+
-
 
+
-
// Menu Functions & Properties
+
-
 
+
-
var activeMenu = null;
+
-
 
+
-
function showMenu() {
+
-
  if(activeMenu){
+
-
    activeMenu.className = "";
+
-
    getNextSiblingByElement(activeMenu).style.display = "none";
+
-
    }
+
-
  if(this == activeMenu){
+
-
    activeMenu = null;
+
-
    }
+
-
    else {
+
-
    this.className = "active";
+
-
    getNextSiblingByElement(this).style.display = "block";
+
-
    activeMenu = this;
+
-
    }
+
-
    return false;
+
-
}
+
-
 
+
-
function initMenu(){
+
-
  var menus, menu, text, a, i;
+
-
  menus = getChildrenByElement(document.getElementById("menu"));
+
-
  for(i = 0; i < menus.length; i++){
+
-
    menu = menus[i];
+
-
    text = getFirstChildByText(menu);
+
-
    a = document.createElement("a");
+
-
    menu.replaceChild(a, text);
+
-
    a.appendChild(text);
+
-
    a.href = "#";
+
-
    a.onclick = showMenu;
+
-
    a.onfocus = function(){this.blur()};
+
-
  }
+
-
}
+
-
 
+
-
if(document.createElement) window.onload = initMenu;
+
-
-->
+
</script>
</script>
</head>
</head>
-
<body><table><tr><td>
+
<body>
-
<div>
+
<table cellspacing="0"><tr><td>
-
<ul id="menu" class="sub">
+
    <ul id="navigation">
-
  <li class="menu_header">&nbsp;
+
        <li class="menu_header">&nbsp;
-
<hr>
+
    <hr>
-
  <li class="title">. Home .
+
        <li class="toggleSubMenu"><span>. Home .</span>
-
    <ol class="active">
+
            <ul class="subMenu">
-
      <li class="active"><a href="https://2009.igem.org/Team:Paris#top">&nbsp;Synopsis</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris#top">Synopsis</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Brainstorm#top">&nbsp;Brainstorm</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Brainstorm#top">Brainstorm</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Project#top">&nbsp;OMV Project</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Project#top">OMV Project</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Modeling#top">&nbsp;Modeling methodes</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Modeling#top">Modeling</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Conclusion#top">&nbsp;Conclusion</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Conclusion#top">Conclusion</a></li>
-
    </ol>
+
            </ul>
-
  </li>
+
        </li>
-
  <li class="title">. Addressing .
+
        <li class="toggleSubMenu"><span>. Addressing .</span>
-
    <ol class="none">
+
            <ul class="subMenu">
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Addressing_overview#top">&nbsp;Export & ClyA</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Addressing_overview#top">Export & ClyA</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Addressing_design#top">&nbsp;Parts</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Addressing_design#top">Parts</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Addressing_testing#top">&nbsp;WetLab</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Addressing_testing#top">WetLab</a></li>
-
    </ol>
+
            </ul>
-
  </li>
+
        </li>
-
  <li class="title">. Production .
+
        <li class="toggleSubMenu"><span>. Production .</span>
-
    <ol class="none">
+
            <ul class="subMenu">
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_overview#top">&nbsp;Tol/Pal system</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Production_overview#top">Tol/Pal system</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_modeling#top">&nbsp;Delay model</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Production_modeling#top">Delay model</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_modeling2#top">&nbsp;Vesicle model</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Production_modeling2#top">Vesicle model</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_design#top">&nbsp;Parts</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Production_design#top">Parts</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_testing#top">&nbsp;WetLab</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Production_testing#top">&nbsp;WetLab</a></li>
-
    </ol>
+
            </ul>
-
  </li>
+
        </li>
-
  <li class="title">. Reception .
+
        <li class="toggleSubMenu"><span>. Reception .</span>
-
    <ol class="none">
+
            <ul class="subMenu">
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_overview#top">&nbsp;Membranes fusion</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Transduction_overview#top">Mbr fusion</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_overview2#top">&nbsp;Transduction</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Transduction_overview2#top">Transduction</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_modeling#top">&nbsp;Fec simulation</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Transduction_modeling#top">Fec simulation</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_design#top">&nbsp;Parts</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Transduction_design#top">Parts</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_testing#top">&nbsp;WetLab</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Transduction_testing#top">WetLab</a></li>
-
    </ol>
+
            </ul>
-
  </li>
+
        </li>
-
  <li class="title">. Ethics .
+
        <li class="toggleSubMenu"><span>. Ethics .</span>
-
    <ol class="none">
+
            <ul class="subMenu">
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Ethics_ethicallabbook#top">&nbsp;Ethical Lab book</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Ethics_ethicallabbook#top">Lab book</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Ethics_Materials#top">&nbsp;Materials</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Ethics_ethicallabbook#top">Report</a></li>
-
    </ol>
+
                <li><a href="https://2009.igem.org/Team:Paris/Ethics_Materials#top">Materials</a></li>
-
  </li>
+
            </ul>
-
  <li class="title">. Tool .
+
        </li>
-
    <ol class="block">
+
        <li class="toggleSubMenu"><span>. Tool .</span>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Tool_introduction#top">&nbsp;Introduction</a></li>
+
            <ul class="open_at_load">
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Tool_DataBase#top ">&nbsp;Databases</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Tool_introduction#top">Introduction</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Tool_OSXSoft#top">&nbsp;Mac Software</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Tool_DataBase#top ">Databases</a></li>
-
      <li class="sub"><a href="https://2009.igem.org/Team:Paris/Tool_iPhone#top">&nbsp;iPhone</a></li>
+
                <li><a href="https://2009.igem.org/Team:Paris/Tool_OSXSoft#top">Mac Software</a></li>
-
    </ol>
+
                <li><a href="https://2009.igem.org/Team:Paris/Tool_iPhone#top">iPhone</a></li>
-
<hr>
+
            </ul>
-
  <li class="menu_footer">&nbsp;</li>
+
        </li>
-
</ul></td></tr>
+
        <li class="menu_footer">&nbsp;</li>
 +
  </ul>
 +
</td></tr>
</table>
</table>
</body>
</body>
-
 
</html>
</html>
-
 
</div>
</div>
<!-- start content area -->
<!-- start content area -->

Revision as of 17:31, 7 October 2009