• Resolved drowosek

    (@drowosek)


    I`m loading my contents through AJAX. So I have a problem with YITH infinity scrolling. I try to stop plugin when I choose the filter on category page, because plugin “YITH IS” add products from category without using filter.

    Maybe I should re-initialize plugin, but I try to use code from another topic, but I have error “.yit_infinitescroll is not a function”
    should I change selectors in this code for my?

    $( yith_infs.contentSelector ).yit_infinitescroll( 
        {
            nextSelector    : yith_infs.nextSelector,
            navSelector     : yith_infs.navSelector,
            itemSelector    : yith_infs.itemSelector,
            contentSelector : yith_infs.contentSelector,
            loader          : '<img src="' + yith_infs.loader + '" />',
            is_shop         : yith_infs.shop
        }
     );
    
    • This topic was modified 2 years, 8 months ago by drowosek.
    • This topic was modified 2 years, 8 months ago by drowosek.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Alessio Torrisi

    (@alessio91)

    HI there,
    maybe you could block all expected events using following JS trigger
    $(this).trigger('yith_infs_start');

    We remain at your disposal.

    Thread Starter drowosek

    (@drowosek)

    Thank you for your hint! I tried to block event scroll, but it does not work. Maybe I used it incorrect. I insert this code after ajax response. I think logically it is good. Could you check it?

    $( window ).on( 'scroll touchstart', function (){
        $(this).trigger('yith_infs_start');
       });
     $( window ).on( 'yith_infs_start', function (){
       return false;
       }); 
    
    • This reply was modified 2 years, 8 months ago by drowosek.
    Thread Starter drowosek

    (@drowosek)

    I solved this issue, with inserting this code:

    $( window ).on( 'scroll touchstart', function (){
       $(this).trigger('yith_infs_start').off();
    });

    but I have another one problem after the cleaning filter, I try to re-initialize infinity scrolling like this

     $( window ).on( 'scroll touchstart', function (){
            $(this).trigger('yith_infs_start').on();
        });

    but it`s not working.

    Plugin Support Alessio Torrisi

    (@alessio91)

    Hi there,
    I did some deep test and unfortunately at the moment it’s not possible apply a change to satisfy your need.

    Thread Starter drowosek

    (@drowosek)

    Maybe it will be useful for somebody. I solved this problem:

    This code for turn off plugin (I insert it after receiving ajax data)

    $( window ).on( 'scroll touchstart', function (){
                $(this).trigger('yith_infs_start').off("scroll");
                $(this).trigger('yith_infs_start').off("touchstart");
            });

    This code for turn on plugin (I insert it in a function which is run when filter is clean)

     $( window ).on( 'scroll touchstart', function (){
            $(this).trigger('yith_infs_start').on("scroll");
            $(this).trigger('yith_infs_start').on("touchstart");
        });

    I know that it is not a perfect solution because we can use
    .off("scroll","touchstart")
    but in my case it does not work.

    • This reply was modified 2 years, 8 months ago by drowosek.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to stop infinity scroll’ is closed to new replies.