这是我的小问题:

我想在动画完成后调用函数。我可以举这个例子。但我需要再打一次。

样例代码

$('.content').animate({
    left: '100'}, {
    duration: 500,
    complete: onComplete /* function is passed as a variable, not called directly ,
                             its doesn't work like : onComplete()*/
});


我已经尝试过跟踪,但不了解。如何解决。

try 1. complete:onComplete, secondonCompletefn
try 2. complete:onComplete,
       complete:secondonCompletefn


谢谢。

最佳答案

$('.content').animate({
    left: '100'}, {
    duration: 500,
    complete: function(){
        onComplete();
        secondonCompletefn();
    }
});

关于javascript - 动画完成后回调函数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32694278/

10-13 01:54