infinite scroll manual trigger

后端 未结 3 1669
暗喜
暗喜 2020-12-25 15:51

Just doesn\'t seem to work... :-( Have seen more complaints about it but I can\'t find the answer.

The Problem: Infinite scroll works but not the ma

相关标签:
3条回答
  • 2020-12-25 15:52

    I made the following tweak to ensure the navigation link showed up after being clicked the first time:

    jQuery("#clickable_element").click(function(){
        jQuery('#main_content_container').infinitescroll('retrieve');
        jQuery('#pagination').show();
        return false;
    });
    
    0 讨论(0)
  • 2020-12-25 15:56

    Maybe... $('#next a').click(); ?

    0 讨论(0)
  • 2020-12-25 16:11

    Pfoe, found it... Long live good documentation (NOT with this plugin!)

    This:

     jQuery('#next a').click(function(){
        jQuery('#next a').infinitescroll('retrieve.infscr');
     return false;
    });
    

    Should be:

    jQuery('#next a').click(function(){
        jQuery('ul#infinite').infinitescroll('retrieve');
     return false;
    });
    

    the biggest problem was the .infscr which shouldn't be there.. Hope it helps someone else..

    Documentation-like solution:

    jQuery("#clickable_element").click(function(){
        jQuery('#main_content_container').infinitescroll('retrieve');
            return false;
    });
    

    Note:
    You may have to add the manual trigger behavior if you are working with masonry or isotope in order to make it work. Just include manual-trigger.js after infinitescroll and pass the behavior by passing behavior: 'twitter' when calling the plugin.

    0 讨论(0)
提交回复
热议问题