如何在不完全破坏动画的情况下停止动画的排队……我尝试使用.stop(),如下所示,但它似乎只是在非常奇怪的时间停止动画,然后不再开始。
$('.work_tile').hover(function() {
$(this).stop().find('.white_bkd').stop().fadeIn('fast');
$(this).stop().children('div.arrow').stop().animate({
"left": "+=305px"
}, "fast");
$(this).stop().children('div.tile_header').stop().animate({
"right": "+=200px"
}, "fast");
}, function() {
$(this).stop().find('.white_bkd').stop().fadeOut('fast');
$(this).stop().children('div.arrow').stop().animate({
"left": "-=305px"
}, "fast");
$(this).stop().children('div.tile_header').stop().animate({
"right": "-=200px"
}, "fast");
})发布于 2012-06-11 16:57:18
请尝试以下代码。希望它能起作用。
$('.work_tile').hover(
function() {
$(this).stop(true,false).find('.white_bkd').stop(true,true).fadeIn('fast');
$(this).stop(true,false).children('div.arrow').stop(true,true).animate({"left": "+=305px"}, "fast");
$(this).stop(true,false).children('div.tile_header').stop(true,true).animate({"right": "+=200px"}, "fast");
},
function() {$(this).stop(true,false).find('.white_bkd').stop(true,true).fadeOut('fast');
$(this).stop(true,false).children('div.arrow').stop(true,true).animate({"left": "-=305px"}, "fast");
$(this).stop(true,false).children('div.tile_header').stop(true,true).animate({"right": "-=200px"}, "fast");
})https://stackoverflow.com/questions/10976850
复制相似问题