Sebastian Rush
Sebastian Rush

Reputation: 538

jQuery infinite ajax scroll trigger/offset issue

I use this infinite scroll plugin jQuery ias which is really well documented and is working perfectly in the most cases.

The problem is, that the following pages are loaded before scroll to the bottom of the container. I need them loaded when the bottom has reached.

This is my jquery part:

jQuery.ias({
    container : '.con',
    item: '.row',
    pagination: ".findopaginator",
    next: "a.flPageNext",
    loader: '<img src="/layout/cyt/img/pageloader.gif">',
    history: false,
    loaderDelay: 1000,
    thresholdMargin: 500, //this is important
    triggerPageThreshold: 3,
    trigger: "Nächste 30 Artikel werden geladen...",
    onRenderComplete: function(items) {...}
});

thresholdMargin:

On default IAS starts loading new items when you scroll to the latest .item element. The thresholdMargin will be added to the items' offset, giving you the ability to load new items earlier (please note that the margin should be a negative integer for this case).

But a positive value does not work.

Maybe somebody had the same problem and has a solution.

Upvotes: 0

Views: 2218

Answers (1)

Fieg
Fieg

Reputation: 3156

If the thresholdMargin is greater then the sum (item height + item offset) it will never reach it. I think this is something the plugin could handle in the future, but until then you have to calculate it yourself.

Upvotes: 1

Related Questions