Template:Paris2009 menu5
From 2009.igem.org
(Difference between revisions)
Christophe.R (Talk | contribs) |
Christophe.R (Talk | contribs) |
||
Line 1: | Line 1: | ||
- | < | + | <html> |
- | < | + | <head> |
- | < | + | <script type="text/javascript"> |
- | + | <!-- | |
- | + | /* This script and many more are available free online at | |
- | + | The JavaScript Source :: http://javascript.internet.com | |
+ | Created by: Travis Beckham :: http://www.squidfingers.com | http://www.podlob.com */ | ||
- | + | /* Coded by Travis Beckham | |
- | + | 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){ | |
- | + | return (filter == null || node.nodeType == Node[filter] || node.nodeName.toUpperCase() == filter.toUpperCase()); | |
- | < | + | } |
- | < | + | |
- | + | function getChildren(node, filter){ | |
- | < | + | var result = new Array(); |
- | + | var children = node.childNodes; | |
- | + | for(var i = 0; i < children.length; i++){ | |
+ | if(checkNode(children[i], filter)) result[result.length] = children[i]; | ||
+ | } | ||
+ | return result; | ||
+ | } | ||
+ | |||
+ | function getChildrenByElement(node){ | ||
+ | return getChildren(node, "ELEMENT_NODE"); | ||
+ | } | ||
+ | |||
+ | function getFirstChild(node, filter){ | ||
+ | var child; | ||
+ | var children = node.childNodes; | ||
+ | for(var i = 0; i < children.length; i++){ | ||
+ | child = children[i]; | ||
+ | if(checkNode(child, filter)) return child; | ||
+ | } | ||
+ | return null; | ||
+ | } | ||
+ | |||
+ | function getFirstChildByText(node){ | ||
+ | return getFirstChild(node, "TEXT_NODE"); | ||
+ | } | ||
+ | |||
+ | function getNextSibling(node, filter){ | ||
+ | for(var sibling = node.nextSibling; sibling != null; sibling = sibling.nextSibling){ | ||
+ | if(checkNode(sibling, filter)) return sibling; | ||
+ | } | ||
+ | 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()}; | ||
+ | } | ||
+ | } | ||
- | <ul> | + | if(document.createElement) window.onload = initMenu; |
- | <li class="menu_header"> </li> | + | //--> |
- | <li > | + | </script> |
- | <li class="menu_footer"> </li> | + | </head> |
+ | <body> | ||
+ | <table> | ||
+ | <ul id="menu"> | ||
+ | <li class="menu_header"> | ||
+ | <hr> | ||
+ | <li class="title">. Home . | ||
+ | <ol class="none"> | ||
+ | <li class="sub"><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"> Brainstorm</a></li> | ||
+ | <li class="sub"><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/Conclusion#top"> Conclusion</a></li> | ||
+ | </ol> | ||
+ | </li> | ||
+ | <li class="title">. Production . | ||
+ | <ol class="none"> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_overview#top"> Overview</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_modeling#top"> Modeling</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_design#top"> Parts design</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Production_testing#top"> Testing</a></li> | ||
+ | </ol> | ||
+ | </li> | ||
+ | <li class="title">. Addressing . | ||
+ | <ol class="none"> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Addressing_overview#top"> Overview</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Addressing_modeling#top"> Modeling</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Addressing_design#top"> Parts design</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Addressing_testing#top"> Testing</a></li> | ||
+ | </ol> | ||
+ | </li> | ||
+ | <li class="title">. Reception . | ||
+ | <ol class="none"> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_overview#top"> Overview</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_modeling#top"> Modeling</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_design#top"> Parts design</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Transduction_testing#top"> Testing</a></li> | ||
+ | </ol> | ||
+ | </li> | ||
+ | <li class="title">. Ethics . | ||
+ | <ol class="block"> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Ethics_ethicallabbook#top"> Ethical Lab book</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Ethics_Materials#top"> Materials</a></li> | ||
+ | </ol> | ||
+ | </li> | ||
+ | <li class="title">. Tool . | ||
+ | <ol class="none"> | ||
+ | <li class="sub"><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_DataBase#top "> Data Base</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Tool_OSXSoft#top"> Software OSX</a></li> | ||
+ | <li class="sub"><a href="https://2009.igem.org/Team:Paris/Tool_iPhone#top"> iPhone</a></li> | ||
+ | </ol> | ||
+ | <hr> | ||
+ | <li class="menu_footer"> </li> | ||
</ul> | </ul> | ||
+ | </table> | ||
+ | </body> | ||
- | </ | + | </html> |
<div id="paris_content_wrapper"> | <div id="paris_content_wrapper"> | ||
<div id=paris_content_boxtop></div> | <div id=paris_content_boxtop></div> | ||
<div id="paris_content"> | <div id="paris_content"> |
Revision as of 15:19, 27 August 2009