When you hover over the div c menu, the background around it dims, but if you hold it so many times, the mouseenter & mouseleave from the diva starts blinking. I decided to set setTimeout , it turned out like this:
$(".subcat > ul").hover(function(){ var time_id = setTimeout(function () { $(".subcat").css({ zIndex: 15 }); $(".subcat_overlay").fadeIn(); }, 1000); }, function(){ $(".subcat").css({ zIndex: 1 }); $(".subcat_overlay").fadeOut(); }); The problem now is that we need a variable that clears time, clearTimeout(time_id); But where to stick it, I do not understand something.
time_idvariable global (time_idout of function), then calmlyclearTimeout(time_id);beforesetTimeout. - Regent