用户通过mouseenter启动动画。但是当他将鼠标悬停在其他元素上以开始下一个动画时,我想立即完成上一个动画。您可以在网站www.checkitout.over.cz/appio上看到动画。谢谢大家。
$(".col3-1 > div").mouseenter(function(){
$(this).find("div").find("span").hide();
$(this).find("div").find("div").hide();
$(this).find("div").css("height", "1.5em");
$(this).find("div").find("div").css("top", "0px");
$(this).find("div").find("div").fadeIn();
$(this).find("div").find("div").animate({
"left": "78px"
}, 200);
});
$(".col3-1 > div").mouseleave(function(){
$(this).find("div").find("span").show();
$(this).find("div").css("height", "2.5em");
$(this).find("div").find("div").css("top", "7px");
$(this).find("div").find("div").css("left", "10px");
});
jQuerystop()
是您所需要的。
stop()
在匹配的元素上停止当前正在运行的动画。
您可以传递额外的参数来停止,
stop(true,true)
清除队列并立即完成当前动画的设置为true
为什么你有两个find()
。用空格分隔它们应该起作用
$(this).find("div span")..
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句