我正在尝试延迟警报,但无法使其工作,当#foo悬停并且大小增加时,它总是弹出:
$('#foo').hover(function() {
$(this).animate({width :'400px'}, 'slow');
},
function() {
$(this).delay(2000).animate({width :'40px'}, 'slow');
alert('Im an alert message');
});
Run Code Online (Sandbox Code Playgroud)
但我希望它只在#foo减少回原始状态后显示...