0

我将无限滚动与 Jquery Masonry 结合使用。一切都很好,除了我无法获得任何用于无限滚动的选项。我正在尝试更改加载文本,添加一个 bufferpx。文档说你可以做到这一点,我完全按照它,但我的网站上没有任何变化。这是我所拥有的:

$(function(){

var $container = $('#loop-wrapper');

$container.imagesLoaded(function(){
  $container.masonry({
    itemSelector: '.hentry'
  });
});

$container.infinitescroll({
  animate  : true,   

  navSelector  : '.navigation-links',    // selector for the paged navigation 
  nextSelector : '.navigation-links a:first-of-type',  // selector for the NEXT link (to page 2)
  itemSelector : '.hentry',     // selector for all items you'll retrieve
  loadingText : 'test',
  bufferpx : '80',
  loading: {
      finishedMsg: 'Thats the end of this gallery.',
      img: 'http://ryanswansondesign.com/wp-content/themes/ryan/images/ajax-loader.gif',
    }
  },
  // trigger Masonry as a callback
  function( newElements ) {
    // hide new items while they are loading
    var $newElems = $(newElements).css({ opacity: 0 });
    // ensure that images load before adding to masonry layout
    $newElems.imagesLoaded(function(){
      // show elems now they're ready
      $newElems.animate({ opacity: 1 });
      $container.masonry( 'appended', $newElems, true ); 
      hoverForTitles();
    });
  }
);

});

4

1 回答 1

1

删除 '80' bufferpx 值周围的 '' ,否则将其作为字符串传递。此外,您可能想在这里查看 github

于 2012-09-28T21:19:30.730 回答