this script fadeIn fadeout many time whenever user hover on it or it's fade in out for long time even user goes elsewhere in page.
how i can stop this menu to fadein fadeout when it's already in progressed or user goes elsewher开发者_运维知识库e
var mainMenu = $("#menu > li");
mainMenu.children("ul").hide();
mainMenu.hover(function () { $(this).children("ul").fadeIn(150); }, function () { $(this).children("ul").fadeOut(150); });
You must call stop jquery function. In order to work it will be
$(this).children("ul").stop(true,true).fadeOut(150);
and
$(this).children("ul").stop(true,true).fadeIn(150);
精彩评论