我正在使用带有过滤功能的无限 ajax-scroll ( https://github.com/webcreate/infinite-ajax-scroll ) 插件。我的过滤器可以使用无限滚动,但我的问题是,每当滚动到达一个过滤器的结果末尾时,即使选择了另一个过滤器,它也将不再滚动。因此,我需要在选择过滤器时重置无限滚动,但我在文档中找不到有关如何重置它的任何地方,并且对 JQuery 不是很好,因此无法解决这个问题。
我也有某些不需要启动滚动的过滤器,并且还需要一种方法来为这些过滤器禁用它。
$('.filter a').click(function() {
//reset scroll somehow
//setTimeout("jQuery.ias({container: '#container'})",1000);
var $this = $(this);
var URL = $this.attr('href');
loadMoreItems(URL, $this);
});
return false;
});
jQuery.ias({
container: '#container', // main container where data goes to append
item: '.element', // single items
pagination: '.paginate', // page navigation
next: '.paginate a', // next page selector
loader: '<img src="public/img/ajax-loader.gif"/>',
noneleft: 'No more discounts for your selection',
triggerPageThreshold: '10',
trigger: "Load more items",
history: false,
thresholdMargin: -350
});