Team:TU Delft/menu2

From 2010.igem.org

(Difference between revisions)
Line 112: Line 112:
<li><a class="menu_button menu_button_blog" href="https://2010.igem.org/Team:TU_Delft/blog" title="Blog">&nbsp;</a></li>
<li><a class="menu_button menu_button_blog" href="https://2010.igem.org/Team:TU_Delft/blog" title="Blog">&nbsp;</a></li>
<li><a class="menu_button menu_button_project" href="https://2010.igem.org/Team:TU_Delft/project" title="Project">&nbsp;</a>
<li><a class="menu_button menu_button_project" href="https://2010.igem.org/Team:TU_Delft/project" title="Project">&nbsp;</a>
-
<ul class="project_submenu submenu_body">
+
<ul>
<li><a href="#">Project Description</a></li>
<li><a href="#">Project Description</a></li>
</ul>
</ul>
Line 126: Line 126:
<script type="text/javascript">
<script type="text/javascript">
-
$(document).ready(function () {$("ul.submenu_body li:even").addClass("alt");
+
var timeout    = 500;
 +
var closetimer = 0;
 +
var ddmenuitem = 0;
-
$('a.menu_button_project').hover(function () {
+
function jsddm_open()
 +
{  jsddm_canceltimer();
 +
  jsddm_close();
 +
  ddmenuitem = $(this).find('ul').css('visibility', 'visible');}
-
$('ul.project_submenu').slideToggle('medium');
+
function jsddm_close()
 +
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}
-
});
+
function jsddm_timer()
 +
{  closetimer = window.setTimeout(jsddm_close, timeout);}
-
$('ul.project_submenu').hover(function () {
+
function jsddm_canceltimer()
-
$this.css("display:block;")
+
{  if(closetimer)
-
});
+
  {  window.clearTimeout(closetimer);
-
});
+
      closetimer = null;}}
 +
 
 +
$(document).ready(function()
 +
$('#navlist > li').bind('mouseover', jsddm_open)
 +
  $('#navlist > li').bind('mouseout',  jsddm_timer)});
 +
 
 +
document.onclick = jsddm_close;
</script>
</script>
</html>
</html>

Revision as of 15:55, 17 June 2010