我正在使用color plugin (链接到 google 缓存,jquery.com 目前已关闭)处理背景颜色动画。
$(".navigation a").hover(
function(){
$(this).stop().animate({backgroundColor: black});
},
function(){
$(this).stop().animate({backgroundColor: green});
$(this).hide();
}
);
动画完成时需要隐藏当前链接。现在它会在 mouseout()
上立即隐藏。
解决方案是什么?
最佳答案
您需要将.hide()
放入.animate()
调用的回调函数中。
$(this).stop().animate(
{backgroundColor: green},
function() {
$(this).hide();
}
);
关于jQuery catch 动画完成时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3667596/