我正在使用带有过滤功能的infinite-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
});
Run Code Online (Sandbox Code Playgroud)