Team:NYMU-Taipei/menu.js
From 2014.igem.org
(Difference between revisions)
m |
m |
||
Line 3: | Line 3: | ||
.on('mouseover', function(){ | .on('mouseover', function(){ | ||
clearTimeout($.data(this,'timer')); | clearTimeout($.data(this,'timer')); | ||
- | $(' | + | $(this).find('ul').stop(true,true).slideDown(200); |
- | + | // $(this).find('ul').css({display:'inline-block'}); | |
}) | }) | ||
.on('mouseout', function(){ | .on('mouseout', function(){ | ||
$.data(this,'timer', setTimeout($.proxy(function() { | $.data(this,'timer', setTimeout($.proxy(function() { | ||
- | $(' | + | $(this).find('ul').stop(true,true).slideUp(200); |
}, this), 100)); | }, this), 100)); | ||
- | + | // $(this).find('ul').css({display:'none'}); | |
}); | }); | ||
}); | }); |
Revision as of 15:06, 2 June 2014
$( document ).ready(function() {
$('#menu > ul > li') .on('mouseover', function(){ clearTimeout($.data(this,'timer')); $(this).find('ul').stop(true,true).slideDown(200); // $(this).find('ul').css({display:'inline-block'}); }) .on('mouseout', function(){ $.data(this,'timer', setTimeout($.proxy(function() { $(this).find('ul').stop(true,true).slideUp(200); }, this), 100)); // $(this).find('ul').css({display:'none'}); });
});