2012-06-11 202 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"); 

    })