jQuery在我的animate()调用中不起作用

jQuery在我的animate()调用中不起作用,jquery,jquery-easing,Jquery,Jquery Easing,我有4个圆形按钮,位于中央区域。悬停其中一个按钮会使其变大,但我想为这些按钮的增长和收缩运动添加一些缓和/反弹效果 然而,由于某些原因,放松部分不起作用。我确实在我的页面中添加了缓解插件: <script src='js/jquery.easing.1.3.js'></script> 您将releasing:说明符放置在错误的位置。应该是这样的: $(document).ready(function(){ $(".egg_button").

我有4个圆形按钮,位于中央区域。悬停其中一个按钮会使其变大,但我想为这些按钮的增长和收缩运动添加一些缓和/反弹效果

然而,由于某些原因,放松部分不起作用。我确实在我的页面中添加了缓解插件:

<script src='js/jquery.easing.1.3.js'></script> 

您将
releasing:
说明符放置在错误的位置。应该是这样的:

$(document).ready(function(){
    $(".egg_button").hover(
        function() {
            var div = $(this);
            div.stop(true, true).animate({
                margin: -5,
                width: "+=10",
                height: "+=10",
                backgroundSize: "30px",         // Instead of here ..
            }, {
                duration: 500, 
                queue:false, 
                easing: 'easeOutBounce'         // .. put it here
            });
        },
        function() {
            var div = $(this);
            div.stop(true, true).animate({
                margin: 0,
                width: "-=10",
                height: "-=10",
                backgroundSize: "22px",        // Instead of here ..
            }, {
                duration: 500, 
                queue:false, 
                easing: 'easeOutBounce'        // .. put it here
            });
        }
    );
});
下面是我为您准备的一个JSFIDLE示例,您可以根据自己的喜好调整设置:


别忘了看看这个,它给你一个更好的印象,每个放松功能到底是做什么的。祝你好运

你能提供一个吗?太好了,谢谢让·保罗!
$(document).ready(function(){
    $(".egg_button").hover(
        function() {
            var div = $(this);
            div.stop(true, true).animate({
                margin: -5,
                width: "+=10",
                height: "+=10",
                backgroundSize: "30px",         // Instead of here ..
            }, {
                duration: 500, 
                queue:false, 
                easing: 'easeOutBounce'         // .. put it here
            });
        },
        function() {
            var div = $(this);
            div.stop(true, true).animate({
                margin: 0,
                width: "-=10",
                height: "-=10",
                backgroundSize: "22px",        // Instead of here ..
            }, {
                duration: 500, 
                queue:false, 
                easing: 'easeOutBounce'        // .. put it here
            });
        }
    );
});