Template:Code
From 2013.igem.org
(Difference between revisions)
Line 86: | Line 86: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | $(function() | + | $(function() { |
- | + | var menu = document.getElementById("side_menu_items"); | |
- | + | var menu_items = menu.childNodes; | |
- | + | for (var i=0; i< menu_items.length; i++) { | |
- | + | if (menu_items[i].tagName == "LI") { | |
- | + | menu_items[i].onmouseover = (function() { | |
- | + | var item = menu_items[i]; | |
- | + | return function() { | |
- | + | var children = item.childNodes; | |
- | + | for (var j=0; j< children.length; j++) { | |
- | + | if (children[j].tagName == "UL") { | |
- | + | children[j].style.display="block"; | |
- | + | } | |
- | + | } | |
- | + | ||
- | + | } | |
- | + | })(); | |
- | + | ||
- | + | menu_items[i].onmouseout = (function() { | |
- | + | var item = menu_items[i]; | |
- | + | return function() { | |
- | + | var children = item.childNodes; | |
- | + | for (var j=0; j< children.length; j++) { | |
- | + | if (children[j].tagName == "UL") { | |
- | + | children[j].style.display= "none"; | |
- | + | } | |
- | }); | + | } |
+ | |||
+ | } | ||
+ | })(); | ||
+ | } | ||
+ | } | ||
+ | }); | ||
var links = document.getElementsByTagName( 'a' ); | var links = document.getElementsByTagName( 'a' ); | ||
Revision as of 15:21, 2 July 2013