2012-06-11 204 views
0

如何阻止排队动画而不完全打破它...我已经尝试使用.stop()如下,但它似乎停止动画在真正的奇怪时间,然后不再开始。停止jquery悬停后的动画

$('.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"); 

})​ 
+0

网站添加是www.fifteenten.co.uk – user1448485

+0

第一站方法是多余的。 – undefined

+0

您可以请指定您应用悬停绑定的元素。我不想通过你的HTML代码并搜索类“work_tile”的某个元素... – iappwebdev

回答

0

请尝试下面的代码。希望它能起作用。

$('.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"); 

    })