2

私のコードの一部:

        anObject.fadeOut(fadeOutTime, function(){
            anObject.css('display', 'none');
            console.log("inside the callback");
            veryImportantMethod();

        });  

残念ながら、コールバックがまだ実行されていないようです。私もそれをデバッグしようとしましたが、コールバック関数の本体をスキップして飛び出すことがあることに気付きました...なぜですか?

4

1 に答える 1

3

その場合は、次を使用します.promise().done()

anObject.fadeOut(fadeOutTime).promise().done(function(){
        anObject.css('display', 'none');
        console.log("inside the callback");
        veryImportantMethod();
    }); 
于 2013-02-12T10:44:20.637 に答える