jQuery:为什么这个动画步骤功能不起作用?

时间:2012-09-21 11:15:45

标签: javascript jquery

我正在使用this Stackoverflow Question中建议的方法,使用slideDown重新创建jQuery animate函数,以便我可以使用step属性。

但是,我无法使步骤属性起作用。这是我的代码:

    infoClone.animate({
        "height": "show",
        "marginTop": "show",
        "marginBottom": "show",
        "paddingTop": "show",
        "paddingBottom": "show",

        step : function() {
            console.log('Step!');
        }
    });

2 个答案:

答案 0 :(得分:5)

您应该将其更改为

infoClone.animate({
    "height": "show",
    "marginTop": "show",
    "marginBottom": "show",
    "paddingTop": "show",
    "paddingBottom": "show"
    }, {
    step : function() {
        console.log('Step!');
    }
});

答案 1 :(得分:2)

试试这个:

infoClone.animate({
        "height": "show",
        "marginTop": "show",
        "marginBottom": "show",
        "paddingTop": "show",
        "paddingBottom": "show"
},
{
  step : function() {
            console.log('Step!');
        }
});