I want to add a setTimeout to the following code so that there's a short pause before the fadeOut effect executes.
$(document).ready(function() {
$('#menu li').hover(
function() {
$('ul', this).slideDown(50);
},
function() {
$('ul', this).fadeOut(100);
}
);
});
This is what I'm trying, but I'm guessing the syntax must be wrong:
$(document).ready(function() {
$('#menu li').hover(
function() {
$('ul', this).slideDown(50);
},
function() {
setTimeout(function() {
$('ul,' this).fadeOut(100);
});
}
);
});
Sorry if this is a dumb question. I'm a beginner with jQuery.