首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >悬停后停止jquery动画

悬停后停止jquery动画
EN

Stack Overflow用户
提问于 2012-06-11 16:44:58
回答 1查看 425关注 0票数 0

如何在不完全破坏动画的情况下停止动画的排队……我尝试使用.stop(),如下所示,但它似乎只是在非常奇怪的时间停止动画,然后不再开始。

代码语言:javascript
复制
$('.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");

})​
EN

回答 1

Stack Overflow用户

发布于 2012-06-11 16:57:18

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

代码语言:javascript
复制
$('.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");

     })
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10976850

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档