0

私はこの良いプラグインをダウンロードしました

http://andersonferminiano.com/jqueryscrollpagination/ と私はこのコードを使用して自分のデータベースを呼び出し、すべての結果を表示します。私の問題は、データベースで終了したときに結果の表示を停止できないことです。ページネーションを停止し、同じ結果を繰り返さないようにします。どうすればできますか?どうもありがとうございます

 $(function(){
                    $('#content').scrollPagination({
                        'contentPage': 'democontent.html', // the page where you are searching for results
                        'contentData': {}, // you can pass the children().size() to know where is the pagination
                        'scrollTarget': $(window), // who gonna scroll? in this example, the full window
                        'heightOffset': 10, // how many pixels before reaching end of the page would loading start? positives numbers only please
                        'beforeLoad': function(){ // before load, some function, maybe display a preloader div
                            $('.loading').fadeIn();
                        },
                        'afterLoad': function(elementsLoaded){ // after loading, some function to animate results and hide a preloader div
                             $('.loading').fadeOut();
                             var i = 0;
                             $(elementsLoaded).fadeInWithDelay();
                             if ($('#content').children().size() > 100){ // if more than 100 results loaded stop pagination (only for test)
                                $('#content').stopScrollPagination();
                             }
                        }
                    });

                    // code for fade in element by element with delay
                    $.fn.fadeInWithDelay = function(){
                        var delay = 0;
                        return this.each(function(){
                            $(this).delay(delay).animate({opacity:1}, 200);
                            delay += 100;
                        });
                    };

                });
4

3 に答える 3

0

mkscroll プラグインを使用して、mk scroll のより多くの機能を提供するリンクを以下に示します。

https://github.com/maulikkanani/Scroll-Pagination

jQuery(window).mkscroll({
         limit:10,              
         total:100,             
     });

その中には他にも多くのオプションがあります。

于 2014-03-22T12:33:36.530 に答える
0

ここで問題を段階的に進めている人が解決策である場合:「次のページ」リンクが利用できなくなると、jscroll はコンテンツの読み込みを停止します。追加された最後のコンテンツに読み込まれます。

于 2014-07-10T13:37:14.880 に答える