Team:TU Delft/menu2
From 2010.igem.org
(Difference between revisions)
Line 38: | Line 38: | ||
padding:2px; | padding:2px; | ||
margin:0; | margin:0; | ||
- | border | + | border: 1px solid #ccc; |
width: 100%; | width: 100%; | ||
z-index:100; | z-index:100; | ||
Line 212: | Line 212: | ||
var ddmenuitem = 0; | var ddmenuitem = 0; | ||
- | function jsddm_open() | + | function jsddm_open() { |
- | { | + | jsddm_canceltimer(); |
- | + | jsddm_close(); | |
- | + | ddmenuitem = $(this).find('ul').css('visibility', 'visible'); | |
} | } | ||
- | function jsddm_close() | + | function jsddm_close() { |
- | { | + | if(ddmenuitem) ddmenuitem.css('visibility', 'hidden'); |
+ | } | ||
- | function jsddm_timer() | + | function jsddm_timer() { |
- | { | + | closetimer = window.setTimeout(jsddm_close, timeout); |
+ | } | ||
- | function jsddm_canceltimer() | + | function jsddm_canceltimer() { |
- | { | + | if(closetimer) { |
- | + | window.clearTimeout(closetimer); | |
- | + | closetimer = null; | |
+ | } | ||
+ | } | ||
- | $ | + | $(function() { |
- | + | $('#navlist > li').bind('mouseover', jsddm_open); | |
- | + | $('#navlist > li').bind('mouseout', jsddm_timer); | |
- | $("#navlist li ul li:even").addClass("alt"); | + | $("#navlist li ul li:even").addClass("alt"); |
}); | }); | ||
Revision as of 12:18, 16 July 2010