4

私は一生、このコードの問題が何であるかを理解できません。アニメーション自体は正常に動作します:

if (!list.is(':animated')) {
    list.animate(
        {"top": "+="+item_size},
        {queue:false, duration:speed},
        function() {
            alert();
        }
    ); // end of animate function

} //end of if statement
4

2 に答える 2

5

の 2 つの署名を混同しています.animate()optionsコールバックを引数の一部にする必要があります。

if(!list.is(':animated')){
    list.animate({
        top: "+="+item_size
    }, //end of properties argument
    {
        queue: false, 
        duration: speed,
        complete: function(){
            alert();
        } //end of callback
    }  // end of options argument
    ); // end of animate function
} //end of if statement
于 2010-10-26T15:32:01.770 に答える
1

APIを確認してください。関数を正しく呼び出していないようです:

.animate( properties, [ duration ], [ easing ], [ callback ] )

これはあなたがそれを呼び出す方法だと思います:

.animate( {"top": "+="+item_size}, speed, 'linear', function(){alert();});

linear必要なイージング関数に変更します。

于 2010-10-26T15:32:30.417 に答える