您可以在鼠标悬停时使用单独的
fadeIn和
fadeOut函数而不是单个函数
fadeToggle,它将解决此问题:
$(".menu-dropdown").hover( function(e) { if ($(window).width() > 943) { $(this).children("ul").stop(true,false).fadeIn(150); e.preventDefault(); } }, function(e) { if ($(window).width() > 943) { $(this).children("ul").stop(true,false).fadeOut(150); e.preventDefault(); } });CodePen 在这里。



