Team:LMU-Munich/Templates/Page Header

From 2012.igem.org

(Difference between revisions)
(preparation for JS menu (ew))
(javascript hackery (works in opera…))
Line 257: Line 257:
}
}
 +
#nav li.over ul {
 +
display: table;
 +
}
</style>
</style>
<style type="text/css" id="hoverstyle">
<style type="text/css" id="hoverstyle">
Line 272: Line 275:
<html>
<html>
</div>
</div>
 +
<script type="text/javascript">
 +
var lis = document.getElementById("nav").getElementsByTagName("li");
 +
 +
function nav_animator(ele) {
 +
ele.my_opacity += ele.delta_opacity;
 +
if(ele.my_opacity < 0) {
 +
ele.my_opacity = 0;
 +
}
 +
if(ele.my_opacity > 1) {
 +
ele.my_opacity = 1;
 +
}
 +
var uls = ele.getElementsByTagName("ul");
 +
for(var i = 0; i < uls.length; ++i) {
 +
uls[i].style.opacity = ele.my_opacity;
 +
}
 +
 +
var mythis = ele;
 +
 +
if(!(ele.my_opacity >= 1.0 || ele.my_opacity <= 0.0)) {
 +
ele.timeout = window.setTimeout(function() {
 +
nav_animator(mythis);
 +
}, 25);
 +
}
 +
 +
if(ele.my_opacity > 0.0) {
 +
ele.setAttribute("class", "over");
 +
} else {
 +
ele.setAttribute("class", "");
 +
}
 +
 +
}
 +
 +
for(var i = 0; i < lis.length; ++i) {
 +
var li = lis[i];
 +
li.my_opacity = 0.0;
 +
li.addEventListener("mouseover", function() {
 +
if(this.timeout != null) {
 +
window.clearTimeout(this.timeout);
 +
this.timeout = null;
 +
}
 +
var timeout = this.my_opacity > 0 ? 25 : 200;
 +
this.delta_opacity = 1.0/8;
 +
var mythis = this;
 +
this.timeout = window.setTimeout(function() {
 +
nav_animator(mythis);
 +
}, timeout);
 +
});
 +
li.addEventListener("mouseout", function() {
 +
if(this.timeout != null) {
 +
window.clearTimeout(this.timeout);
 +
this.timeout = null;
 +
}
 +
var timeout = this.my_opacity < 1 ? 25 : 200;
 +
this.delta_opacity = -1.0/8;
 +
var mythis = this;
 +
this.timeout = window.setTimeout(function() {
 +
nav_animator(mythis);
 +
}, timeout);
 +
});
 +
}
 +
var style = document.getElementById("hoverstyle");
 +
style.parentNode.removeChild(style);
 +
</script>
<div id="left">
<div id="left">
</html>
</html>

Revision as of 20:02, 5 August 2012

iGEM Ludwig-Maximilians-Universität München Beadzillus

Team-LMU Sidebar Home.jpg

The LMU-Munich team is exuberantly happy about the great success at the World Championship Jamboree in Boston. Our project Beadzillus finished 4th and won the prize for the "Best Wiki" (with Slovenia) and "Best New Application Project".

IGEM HQ LMU prize.jpg

[ more news ]