Template:Uppsala-SwedenTemplate

From 2011.igem.org

(Difference between revisions)
Line 174: Line 174:
}
}
 +
 +
 +
<!-- START:DROP-DOWN MENU STYLE SHEET (Source: http://www.alistapart.com/articles/dropdowns/) -->
 +
 +
`startList = function() {
 +
if (document.all&&document.getElementById) {
 +
navRoot = document.getElementById("nav");
 +
for (i=0; i<navRoot.childNodes.length; i++) {
 +
node = navRoot.childNodes[i];
 +
if (node.nodeName=="LI") {
 +
node.onmouseover=function() {
 +
this.className+=" over";
 +
  }
 +
  node.onmouseout=function() {
 +
  this.className=this.className.replace(" over", "");
 +
  }
 +
  }
 +
  }
 +
}
 +
}
 +
window.onload=startList;
 +
 +
ul {
 +
  padding: 0;
 +
  margin: 0;
 +
  list-style-type: none;
 +
  }
 +
li {
 +
  float: left;
 +
  position: relative;
 +
  width: 10em;
 +
  }
 +
 
 +
li ul {
 +
  display: none;
 +
  position: absolute;
 +
  top: 1em;
 +
  left: 0;
 +
  }
 +
li > ul {
 +
top: auto;
 +
left: auto;
 +
}
 +
 +
li:hover ul, li.over ul{ display: block; }
 +
clear: left
 +
 +
<!-- END: DROP-DOWN MENU STYLE SHEET-->
 +
-------------------
-------------------

Revision as of 14:10, 17 June 2011