我有以下 jQuery 代码
$("#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();
}
);
我期望发生的是当鼠标离开时#dropdown
它会等待 1 秒钟然后继续。这没有发生。
如果有更好的方法,我想要实现的是在移动鼠标后让下拉菜单可见一两秒钟,我还想防止事件再次发生以防止伪影和“有趣” " 如果您要快速将鼠标从 div 上移出和移出