Skip to content

Infinite scroll in tab navigation problem #354

@DariuszPowroznik

Description

@DariuszPowroznik

Hi,
I'm trying to use your infinite-ajax-scroll (v3) on page where I have tab navigation (from Bootstrap v4). In one tab I have articles and in second I have products.
In both I wanted to have infinity scroll working independent.

I was trying to working with bind/unbind but it's not working. This is how I tried to use it:

       var art = new InfiniteAjaxScroll('#Articles', {
            item: '.Article',
            next: '.nextArt',
            pagination: '#ArticlePagination',
            spinner: '.Artspinner'
        });

        var prod = new InfiniteAjaxScroll('#Products', {
            item: '.InfiniteProduct',
            next: '.nextProduct',
            pagination: '#ProductPagination',
            spinner: '.Prodspinner',
            bind: false
        });

        $('#tab-newsSearch').on('click', function (e) {
            e.preventDefault();
            prod.unbind();
            setTimeout(function () { art.bind(); }, 100);
        })

        $('#tab-productsSearch').on('click', function (e) {
            e.preventDefault();
            art.unbind();
            setTimeout(function () { prod.bind();  }, 100);
        })

Is there any posibility yo use it that way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions