我有这样的脚本:jQuery的延迟鼠标移出
$("#menu ul li").mouseover(
function() {
$(this).find(".submenu").fadeIn("slow");
}
);
var timer = 0;
function animate_me() {
$(this).find(".submenu").stop().fadeOut("slow");
}
$(function(){
$("#menu ul li").mouseout(function(){
timer = setTimeout("animate_me()", 300); // start timer when mouse is moved in
}, function() {
clearTimeout(timer); // stop it if mouse is moved out
});
});
我如何延缓淡出,直到菜单UL里已经打探过两秒钟?
延迟只会延迟淡出 - 我需要它停止函数,如果再次注销 – maccaj51 2012-02-07 12:43:25
如果您使用true作为第一个参数在'.stop()'它停止延迟也...试试演示... – meo 2012-02-07 12:46:55