JQuery lag not working as expected
I have the following jQuery code
$("#dropdown").hover(function() {
$(this).stop(true,true).fadeTo('fast',1);
$("#options").stop(true,true).slideDown();
}, function() {
$(this).delay(1000).stop(true,true).fadeTo('fast',0.1);
$("#options").delay(1000).stop(true,true).slideUp();
}
);
What I expect will happen when the mouse leaves #dropdown
, it will wait 1 second before continuing. This is not happening.
What I am trying to achieve, in case there is a better way, is to keep the dropdown visible for a second or two after moving the mouse, and I would also like to prevent recurring events to prevent artifacts and "funnies". if you have to quickly and quickly get the mouse out of the div
+2
a source to share