expandtheroom/jquery-infinite-scroll-helper

scroll position asking

Closed this issue · 4 comments

chi07 commented

Hi @rogden

Firstly, i wanna say thank for sharing awesome plugin. I have a minor issue. When i scroll i have to scroll up and down to load my content. Here is the link: Please help me check: https://iwebcoding.com

When i test on my mobile, it loaded first page only. Please help me check. How can i fix this.
Thanks so much!

Is this a mobile only issue or does it happen on desktop as well?

chi07 commented

Hi @rogden. Now, on desktop is working fine, just happen on mobile only.

Ok, you will have to post the code that you are using so I can take a look. I only see the minified script file on your site.

chi07 commented

Thanks @rogden for your time. Here is my code
var loadingCount = 0,
totalPages = "{!! $totalPages !!}";

        $(function() {
            (function() {
                var pageCount;
                $('#main-content-left').infiniteScrollHelper({
                    loadMore: function(page, done) {
                        pageCount = page;

                        $.get('/get-category/' + page, function(data){
                            $('#main-content-left').append(data.response);
                        });
                        setTimeout(
                            function() {
                                if (pageCount == totalPages) {
                                    $('#main-content-left').infiniteScrollHelper('destroy');
                                    $('.loader').hide();
                                }
                                done();
                            }
                            , 20
                        );
                    },
                    bottomBuffer: 80,
                    triggerInitialLoad: true
                })
            }());
        });

Please help me check. Thanks in advanced