Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instantclick + infinite-scroll #152

Open
kamov opened this issue Feb 26, 2017 · 0 comments
Open

Instantclick + infinite-scroll #152

kamov opened this issue Feb 26, 2017 · 0 comments

Comments

@kamov
Copy link

kamov commented Feb 26, 2017

I am using infinite-scroll jquery plugin. Instantclick stop working after infinite-scroll load more pages.

I try in different way but can't find a solution. Instantclick stop work and I can't even re-init again in callback of infinite-scroll.

I don't find anything here http://reed.github.io/turbolinks-compatibility/

This is semplified version of my code:

(function() {
    'use strict';

        InstantClick.on('change', function() {
            $('#container').infinitescroll('destroy');
           $('#container').infinitescroll({
               nextSelector: "a.next-page",
               navSelector: ".pagination",
               itemSelector: ".item",
            }, function(data){
               console.log('Reload instantclick');
               InstantClick.init();   // With this the page start load via instant click, but then is loaded normally
           });
        });
        InstantClick.init();
})();

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant