fredwu / jquery-endless-scroll

Endless/infinite scrolling/pagination.
http://fredwu.github.com/jquery-endless-scroll/
837 stars 176 forks source link

When using callback function, it only calls once. #38

Open nffdiogosilva opened 10 years ago

nffdiogosilva commented 10 years ago
$("#events").endlessScroll({
                inflowPixels: 100,
                fireOnce: true,
                fireDelay: 10,
                callback: function(i, p, d){
                    console.log(i, p, d);
                }
            });

Any clue what might be?

Version is: 1.8.0

nffdiogosilva commented 10 years ago

If I change ceaseFireOnEmpty to false.... it keeps onGoing...

fredwu commented 10 years ago

Well, it's been over a year since I used the library I am not really sure. Perhaps give version 1.6 a try?

nffdiogosilva commented 10 years ago

I'm not sure, but i believe that the problem was that i was calling an ajax request inside the callback function.

It would receive JSON data , than i would append that data on the div. After that, the callback wouldn't work anymore.

Anyway, i have solved the problem, using my own code.

When i have the time, i'll do a jsfiddle replicating the problem.