1

「少数」の要素を同時にアニメーション化する必要があるサイトがあります。すべての要素のアニメーション化が終了したら(これをテストし$(:animated) == 1ます)、ajaxリクエストがあります。約120個の要素に対してはすべて正常に機能しますが、要素数が増えると、スクリプトがビジー状態になり、ブラウザがスクリプトを停止するように求めます:-/ここに私のコードがあります:

$('.wrapper-1, .wrapper-2').animate({
            scrollLeft: 50
        },{
            queue: false, //I thought this would help, has no influence
            complete: function() {
                if($(':animated').length==1){

                        //do fancy stuff and get ajax contents              

                } //END if animated
            }//END scroll animation complete
        });//END animate

より多くの要素を処理する方法を知っている人はいますか??

ありがとう

4

0 に答える 0